我试图通过pandas来查看导入的数据,但是当我运行脚本时,会出现错误"int‘对象没有属性’iloc‘。我是新来的,这是我的第一篇文章,如果我不知道规则,很抱歉。我的代码如下所示。
import pandas as pd
from matplotlib import pyplot
from pandas import read_csv
filename = '/Users/rahulparmeshwar/Documents/Algo Bots/Data/Live Data/Tester.csv'
data = read_csv(filename)
pd.set_option('display.width',100)
pd.DataFrame.head(1)
print(pd)
我也是Python的新手。
发布于 2021-07-31 12:59:20
您希望在数据帧data
上调用head()
,而不是在构造函数pd.DataFrame
上调用。
data = read_csv(filename)
pd.set_option('display.width',100)
print(data.head(1))
https://stackoverflow.com/questions/68605788
复制相似问题