【发布时间】:2020-08-04 21:54:09
【问题描述】:
我已经使用下面的代码和输出下载了一个数据集:
def aroon(symbol):
aroon = TechIndicators(key='',output_format='pandas')
data, meta_data = aroon.get_aroon(symbol = symbol, interval = 'daily')
modifiedfp = pandas.DataFrame(data)
modifiedfp = modifiedfp.reset_index()
modifiedfp
print modifiedfp
x = aroon('msft')
和输出:
date Aroon Down Aroon Up
0 2020-04-07 45.0 100.0
1 2020-04-08 40.0 95.0
2 2020-04-09 35.0 90.0
3 2020-04-13 30.0 85.0
4 2020-04-14 25.0 100.0
5 2020-04-15 20.0 95.0
6 2020-04-16 15.0 100.0
7 2020-04-17 10.0 100.0
8 2020-04-20 5.0 95.0
9 2020-04-21 0.0 90.0
Process finished with exit code 0
数据表正常,但是当我尝试使用以下内容隔离列时,我收到此错误:
y = x['Aroon Down']
Traceback (most recent call last):
File "/Users/davidgaballa/Library/Preferences/PyCharmCE2018.3/scratches/scratch_7.py",
line 37, in <module>
y = x['Aroon Down']
TypeError: 'NoneType' object has no attribute '__getitem__'
最终,我想将这些列中的一个附加到另一个数据帧,但是当我尝试并一直在向后工作以隔离问题时遇到了同样的问题。在我看来,所有行都有一个值,所以我不确定为什么会遇到这个问题。谢谢您的帮助。
【问题讨论】:
标签: python pandas dataframe append nonetype