[英]accessing columns of a pandas data frame (python)
I have the following python pandas data frame , 我有以下python pandas数据框,
The column names are numerical. 列名是数字。 Let say that this data frame is DF_data . 可以说这个数据帧是DF_data 。 I need to access the 4th column of this data frame. 我需要访问此数据框的第四列。
I tried 我试过了
DF_data['2.5']
, but it didnt work . DF_data['2.5']
,但是没有用。
Can anyone suggest any way to do this ? 任何人都可以提出任何建议吗?
Your column names are probably float
; 您的列名可能是float
; try DF_data[2.5]
(without the quote). 尝试DF_data[2.5]
(不带引号)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.