我有一个看起来像
Country | IndicatorName | Value
Spain | Indicator1 | 3
Spain | Indicator2 | 4
Germany | Indicator16 | 24
......
我想把它转换成一个带有IndicatorName列、Country行和值交叉点的数据帧
Country | Indicator 1 | Indicator 2 | Indicator 3 | ......
Spain | 3 | 4 | 16 | ......
Germany | 23 | 232 | 232 | ......
.......
我正在尝试通过groupby([“IndicatorName”,“Value”]),但不确定如何继续
import pandas as pd
indicators = pd.read_csv("Indicators.csv")
indicators.groupbby(["IndicatorName","Value"])
.....
有没有合适的方法来处理这个问题,或者需要通过迭代来完成?你知道吗
我不确定初始df格式,因为所需的df似乎有不同的值。你知道吗
下面的内容有用吗?你知道吗
相关问题 更多 >
编程相关推荐