![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
喂他柠檬茶
这个作者很懒,什么都没留下…
展开
-
AttributeError: module ‘pandas‘ has no attribute ‘ewma‘问题解决方法
version 0.18.0之后改成ewm()这个函数了。将ewma60=pd.ewma(aapl_px,span=60)改为ewma60 = pd.DataFrame.ewm(aapl_px,span=60).mean()转载 2021-01-10 20:02:57 · 1795 阅读 · 1 评论 -
时间序列预测-Python中使用LSTM和PyTorch预测航班数据集
翻译自外网,这是我觉得少数在做预测的实验原文链接时间序列数据,顾名思义,是一种随时间变化的数据类型。例如,24小时时间段内的温度,一个月内各种产品的价格,某一特定公司一年内的股票价格。先进的深度学习模型,如Long Short Term Memory Networks (LSTM),能够捕捉时间序列数据中的模型,因此可以用来预测数据的未来趋势。在本文中,您将看到如何使用LSTM算法使用时间序列数据进行未来预测。在本文中,我们将使用PyTorch库,这是深度学习中最常用的Python库之一。在继续学习之翻译 2020-12-17 21:00:37 · 7903 阅读 · 13 评论 -
python生成正弦函数并保存为csv文件
import numpy as npimport matplotlib.pyplot as pltimport pandas as pdx=np.linspace(0,8*np.pi,8*16) #8/2=4 4个完整的正弦波波形 8*16代表一共生成的点数量y=43+43*np.sin(x) #调整43这个值可以调整波峰值y1=y.astype(int) #把y值转换成整数plt.plot(x,y1,'bp--') #绘制成图表plt.show() #显式图像y = pd.Dat原创 2020-12-15 15:42:37 · 1339 阅读 · 0 评论 -
torch.cuda.is_available()false安装pytorch慢解决方法
import torchprint(torch.__version__)print('gpu',torch.cuda.is_available())结果为问题应该是版本不匹配解决办法卸载pytorchpip uninstall torchconda uninstall pytorchconda uninstall libtorch安装对应版本1、从pytorch官网获取安装命令https://pytorch.org/官网下载很慢,截取连接到迅雷,https://downl原创 2020-12-10 21:09:40 · 237 阅读 · 2 评论 -
Traceback (most recent call last)IndexError: invalid index of a 0-dim tensor. Use `tensor.item()
Traceback (most recent call last):File “C:/Users/zzj/Desktop/zzj_battery/venv/test.py”, line 84, in print(‘Epoch: {}, Loss: {:.5f}’.format(e + 1, loss.data[0]))IndexError: invalid index of a 0-dim tensor. Use tensor.item() in Python or tensor.item<T&原创 2020-11-26 21:13:52 · 290 阅读 · 0 评论 -
Bad key in file You probably need to get an updated matplotlibrc file from https://github.com/matplo
使用mathplot遇到了下面的问题Bad key animation.mencoder_path in file C:\Users\zzj\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\mpl-data\stylelib\_classic_test.mplstyle, line 509 ('animation.mencoder_path: mencoder')You probably need to get an upda原创 2020-11-22 16:22:07 · 3394 阅读 · 4 评论