DatetimeIndex无法执行操作平均值

时间:2019-06-05 13:59:44

标签: python python-3.x pandas seaborn

我正在尝试为熊猫数据框的图实现最合适的一条线。

我收到错误消息“ DatetimeIndex无法执行操作平均值”,这就是我的数据帧的样子:

      date  new builds  new houses  new homes  help to buy  
0   2014-06-08       4          29         79           12   
1   2014-06-15       4          31         79           11   
2   2014-06-22       5          31         80           12   
3   2014-06-29       5          29         81           11   
4   2014-07-06       5          31         82           12   
5   2014-07-1        5          33         82           12   
6   2014-07-20       4          32         85           12   
7   2014-07-2        5          33         89           13   

这是我用来尝试绘制最合适的线的代码

sns.regplot(x='date',y='new builds',data=data, fit_reg=True)

0 个答案:

没有答案