Pandas 请选择整个列
我使用pandas-groupby方法获得以下数据帧。如何从这个数据框中选择整个列,例如名为EventID或Value的列 df['Value']返回整个数据帧,而不仅仅是值列Pandas 请选择整个列,pandas,Pandas,我使用pandas-groupby方法获得以下数据帧。如何从这个数据框中选择整个列,例如名为EventID或Value的列 df['Value']返回整个数据帧,而不仅仅是值列 Value Realization Occurrence EventID 1 207 2023378 20 213 2
Value
Realization Occurrence EventID
1 207 2023378 20
213 2012388 25
291 2012612 28
324 2036783 12
357 2255910 45
399 2166643 64
420 2022922 19
2 207 2010673 56
249 2018319 77
282 2166809 43
df['Value']
只是值列。之所以有如此多的其他数据,是因为df['Value']
有一个包含三个级别的属性
要删除多重索引,可以使用
df['Value'].reset_index(drop=True)
或者,您可以使用
df['Value'].values