我正在使用以下代码将数据从this csv file导入到熊猫DataFrame
中。而且我希望获得Series
数据,但是却收到错误消息。
df = pd.read_csv('../../data/gen/the_file.csv'.format(symbol),
parse_dates=True,
index_col=0)
df.info()
close_series = df.close
<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 392 entries, 2017-06-12 to 2018-12-31
Data columns (total 12 columns):
close 392 non-null float64
high 392 non-null float64
low 392 non-null float64
p_change 392 non-null float64
open 392 non-null float64
pre_close 392 non-null float64
volume 392 non-null int64
date 392 non-null int64
date_week 392 non-null int64
key 392 non-null int64
atr21 392 non-null float64
atr14 392 non-null float64
dtypes: float64(8), int64(4)
memory usage: 39.8 KB
AttributeError: 'DataFrame' object has no attribute 'close'
非常感谢您的帮助!谢谢!