prophet uses deprecated numpy np.float/int aliases
- Dominant language
- Python
- Stars
- 20.4k
- Forks
- 4.6k
- Avg merge
- 19h 52m
- Merged PRs (30d)
- 1
Description
Running the basic car sales example
```
from pandas import read_csv
from pandas import to_datetime
from fbprophet import Prophet
# load data
path = 'https://raw.githubusercontent.com/jbrownlee/Datasets/master/monthly-car-sales.csv'
df = read_csv(path, header=0)
# prepare expected column names
df.columns = ['ds', 'y']
df['ds']= to_datetime(df['ds'])
# define the model
model = Prophet()
# fit the model
model.fit(df)
```
fails against my python-numpy 1.26.4 (that's far before 2.0!) with:
```
File "", line 1, in
File "/usr/lib/python3.10/site-packages/fbprophet/forecaster.py", line 1115, in fit
self.make_all_seasonality_features(history))
File "/usr/lib/python3.10/site-packages/fbprophet/forecaster.py", line 765, in make_all_seasonality_features
features = self.make_seasonality_features(
File "/usr/lib/python3.10/site-packages/fbprophet/forecaster.py", line 458, in make_seasonality_features
features = cls.fourier_series(dates, period, series_order)
File "/usr/lib/python3.10/site-packages/fbprophet/forecaster.py", line 434, in fourier_series
.astype(np.float)
File "/usr/lib/python3.10/site-packages/numpy/__init__.py", line 324, in __getattr__
raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
```
also
```
File "/usr/lib/python3.10/site-packages/fbprophet/forecaster.py", line 401, in set_changepoints
.astype(np.int)
AttributeError: module 'numpy' has no attribute 'int'.
```
This may be fixed by changing them into float64/int64.
see also https://github.com/facebook/prophet/issues/2404
Contributor guide
Assessment
This issue has not been assessed yet.