我只看到了与我在这里寻找的东西相反的帖子。使用jupyter notebooks/python,我从csv文件导入了第一个块,我想要第二个块:
Country | 1990 | 1991 | 1992 |
----------------------------------
| Albania | 1.0 | 1.2 | 2.6 |
| Algeria | 2.0 | 2.3 | 3.3 |
| Andora | 1.5 | 6.9 | 5.3 |
Country | Year | Value |
------------------------------
| Albania | 1990 | 1.0 |
| Albania | 1991 | 1.2 |
| Albania | 1992 | 2.6 |
| Algeria | 1990 | 2.0 |
| Algeria | 1990 | 2.3 |
| Algeria | 1990 | 3.3 |
etc.
我是python新手,不确定是否需要使用pandas、numpy以及什么函数(pivot_table、re index、interpolate)。
谢谢
大熊猫的融化功能就可以了!!
熔融重塑df相对于年份!!
^{pr2}$我把你的测向搞砸了,你的案子也一样。 有关熔融的更多信息http://pandas.pydata.org/pandas-docs/stable/generated/pandas.melt.html
试试这个:
相关问题 更多 >
编程相关推荐