在这里,我想将 2 列数据框转换为新系列。“max”应该是索引,“price”是新系列的值。怎么做 ?我下面使用的方式似乎不正确: pd.Series(a['max'], index=a['price'])
>>> a
price max
0 4.0 86
1 5.0 87
2 6.0 88
3 7.0 91
4 8.0 91
.. ... ...
385 1900.0 98
386 2000.0 97
387 2013.0 91
388 2500.0 96
389 3300.0 88
[390 rows x 2 columns]
>>> type(a)
<class 'pandas.core.frame.DataFrame'>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1239 次 |
| 最近记录: |