Comments (5)
Had the same issue when using a virtualenv with Python 2.7. Creating a new one with Python 3.5.1 solved the problem for me.
from prophet.
Here's my version information and the full traceback:
Ubuntu 16.04.1 LTS
Python 3.5.2 |Anaconda 2.4.1 (64-bit)| (default, Jul 2 2016, 17:53:06)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-8-a76c855f084a> in <module>()
----> 1 m.fit(df)
/home/z/anaconda3/lib/python3.5/site-packages/fbprophet/forecaster.py in fit(self, df)
337 history = self.setup_dataframe(history, initialize_scales=True)
338 self.history = history
--> 339 seasonal_features = self.make_all_seasonality_features(history)
340
341 self.set_changepoints()
/home/z/anaconda3/lib/python3.5/site-packages/fbprophet/forecaster.py in make_all_seasonality_features(self, df)
286 365.25,
287 10,
--> 288 'yearly',
289 ))
290
/home/z/anaconda3/lib/python3.5/site-packages/fbprophet/forecaster.py in make_seasonality_features(cls, dates, period, series_order, prefix)
227 @classmethod
228 def make_seasonality_features(cls, dates, period, series_order, prefix):
--> 229 features = cls.fourier_series(dates, period, series_order)
230 columns = [
231 '{}_{}'.format(prefix, i + 1)
/home/z/anaconda3/lib/python3.5/site-packages/fbprophet/forecaster.py in fourier_series(dates, period, series_order)
216 t = np.array(
217 (dates - pd.datetime(1970, 1, 1))
--> 218 .apply(lambda x: x.days)
219 .astype(np.float)
220 )
/home/z/anaconda3/lib/python3.5/site-packages/pandas/core/series.py in apply(self, func, convert_dtype, args, **kwds)
2167 values = lib.map_infer(values, lib.Timestamp)
2168
-> 2169 mapped = lib.map_infer(values, f, convert=convert_dtype)
2170 if len(mapped) and isinstance(mapped[0], Series):
2171 from pandas.core.frame import DataFrame
pandas/src/inference.pyx in pandas.lib.map_infer (pandas/lib.c:62578)()
/home/z/anaconda3/lib/python3.5/site-packages/fbprophet/forecaster.py in <lambda>(x)
216 t = np.array(
217 (dates - pd.datetime(1970, 1, 1))
--> 218 .apply(lambda x: x.days)
219 .astype(np.float)
220 )
AttributeError: 'numpy.timedelta64' object has no attribute 'days'
I didn't have any issues running this with conda on OSx.
from prophet.
The approaches described in the pandas docs both work for me, but I'm still not sure why it works on my Mac but not on my Linux system.
# to days
In [70]: td / np.timedelta64(1,'D')
Out[70]:
0 31.000000
1 31.000000
2 31.003507
3 NaN
dtype: float64
In [71]: td.astype('timedelta64[D]')
Out[71]:
0 31
1 31
2 31
3 NaN
dtype: float64
from prophet.
@robin-weiss I think you're right. I upgraded to Anaconda2-4.3.0
and it works fine now. The problem seems to be because of an older version of pandas.
from prophet.
I got the same problem on my mac with python2.7.10 + pandas-0.17.1, use pip install -U pandas ; I update my pandas to 0.19.2, and the problem solved
from prophet.
Related Issues (20)
- I have a issue in installation of prophet library HOT 2
- error in pip install pystan, cython was installed, does anyone know how to solve it?
- Fit params for kwargs
- fbprophet installing error HOT 1
- RuntimeError: Error during optimization: console log output: dyld[10867]: Symbol not found
- pip install guardrails getting this error HOT 2
- Prophet Training Speed: Intel vs Apple M1/M2 HOT 2
- RuntimeError: Error during optimization! HOT 3
- fbprophet install error fix
- BUG - Cannot predict on using logistic -> All-NaN slice encountered HOT 1
- Add interactions to weekly/daily periods for hourly univariate time series data
- [BUG] Zero Division in diagnostics.performance_metrics() causing failed assertion
- Using prophet 1.1.4 (python), is it possible to get "adapt_delta" passed down to stan as part of the "fit" call?
- I am a beginner and I do not know How to solve this Error HOT 5
- Loading META Prophet model gives a tz, datetime error HOT 1
- select_()` was deprecated in dplyr 0.7.0
- How to add some new E-commerce holidays for one country HOT 2
- KeyError: 'k' missing
- prophet uses deprecated numpy np.float/int aliases HOT 1
- Covid One Off Holidays HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prophet.