Python3.4雅虎财务和matplotlib干扰
我对python编程非常陌生,所以我才刚刚开始实验 基本上,我正试图通过使用Yahoo Finance库请求市场数据,并使用matplotlib进行绘图 以下是我使用的代码:Python3.4雅虎财务和matplotlib干扰,python,matplotlib,yahoo-finance,strptime,Python,Matplotlib,Yahoo Finance,Strptime,我对python编程非常陌生,所以我才刚刚开始实验 基本上,我正试图通过使用Yahoo Finance库请求市场数据,并使用matplotlib进行绘图 以下是我使用的代码: #!/usr/bin/python3 from yahoo_finance import Share from datetime import datetime, date, timedelta #from matplotlib import pyplot as plt stm = Share("GOOG") d
#!/usr/bin/python3
from yahoo_finance import Share
from datetime import datetime, date, timedelta
#from matplotlib import pyplot as plt
stm = Share("GOOG")
durée = timedelta(days=10)
lst = stm.get_historical(str(date.today()-durée), str(date.today()))
jours = [f['Date']for f in lst]
cours = [f['Open']for f in lst]
print(jours)
print(cours)
#plt.plot(jours, cours)
#plt.show()
以这种方式执行时,列表“jours”和“cours”打印得很好。
如果我取消注释代码的绘图部分,则会在以下方面出错:
stm = Share("GOOG")
在模块_strptime.py中:未转换的数据保留:pm
我很失望,因为它发生在以前工作过的代码中
我认为这可能是不同模块上的库调用之间的某种干扰,但我对python了解不够,无法亲自调试
有什么想法吗