facebook / facebook/prophet

Pandas time series plotting not working

未關閉
#999 13 則留言 46 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
20.4k
分支
4.6k
平均合併
19 小時 52 分鐘
30 天內合併 PR
1

描述

Hello,

I created an Anaconda environment on MacOS using:
`conda install jupyter pandas fbprophet seaborn`

I have a Pandas DataFrame with a DatetimeIndex. I am plotting the time series using the pandas functionality:

```
df["ds"] = pd.to_datetime(df["ds"])
df = df.set_index("ds")
df[["y"]].plot()
```

The code works if I don't import fbprophet and fails after I import it with the error:
`TypeError: float() argument must be a string or a number, not 'Period'`

Checking the code I noticed that the [matplotlib converters are being deregistered](https://github.com/facebook/prophet/blob/ebb304680d126e5d3a83d4ef9eb1f50cb5965273/python/fbprophet/plot.py#L29).

The code works if I add `pd.plotting.register_matplotlib_converters()` before plotting.

Is there a reason for using deregister_matplotlib_converters()?

Thanks

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。