gpt4 book ai didi

python - 如何根据列表重新排序数据框? Pandas

转载 作者:行者123 更新时间:2023-12-02 00:28:37 26 4
gpt4 key购买 nike

<分区>

我有一个 df,我想根据使用 Python 显示的列表对其重新排序:

df=pd.DataFrame({'Country':["AU","DE","UR","US","GB","SG","KR","JP","CN"],'Stage #': [3,2,6,6,3,2,5,1,1],'Amount':[4530,7668,5975,3568,2349,6776,3046,1111,4852]})

df

list=["US","CN","GB","AU","JP","KR","UR","DE","SG"]

我该怎么做?有什么想法吗?谢谢!

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com