我有几个要输入数据框的列表:
mydates = [0, 6, 15, 21, 30, 37, 45, 53]
prices = [30.4, 32.5, 31.7, 31.2, 32.7, 34.1, 35.8, 37.8]
mylist = [6.907894736842111, -2.461538461538464, -1.5772870662460567,4.807692307692319,
4.2813455657492305, 4.985337243401747, 5.5865921787709505, -3.9682539682539684]
我进入
df = DataFrame(prices, mylist, index=mydates, columns=['Prices', 'Percentage
s'])
并收到此错误:
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: __init__() got multiple values for keyword argument 'index'
虽然如果我输入这个一切正常。
df = DataFrame(prices, index=mydates, columns=['Prices'])
有人可以告诉我如何解决问题吗?.