[英]Extracting column from numpy array - unhashable array
I have a file of experimental data that I have parsed into a numpy array. 我有一个已解析为numpy数组的实验数据文件。 I am attempting to extract the first column of the array into a variable using: 我试图使用以下方法将数组的第一列提取到变量中:
Thermo_Col = df[:,[0]]
where Thermo_Col
is the column of temperatures and df is the numpy array 其中Thermo_Col
是温度列,df是numpy数组
and I get an error 我得到一个错误
TypeError: unhashable type
Help 救命
我认为df不是一个numpy数组,而是一个DataFrame,请尝试以下操作:
df.iloc[:, [0]]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.