Skip to content

Commit 0485991

Browse files
committed
Remove deprecated usage of Series.nonzero()
Series.nonzero() was deprecated in pandas-dev/pandas#24048. Using the latest pandas breaks fbprophet. We can replace .nonzero() use with .to_numpy().nonzero().
1 parent 57990e6 commit 0485991

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/fbprophet/forecaster.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ def set_auto_seasonalities(self):
942942
first = self.history['ds'].min()
943943
last = self.history['ds'].max()
944944
dt = self.history['ds'].diff()
945-
min_dt = dt.iloc[dt.values.nonzero()[0]].min()
945+
min_dt = dt.iloc[dt.values.to_numpy().nonzero()[0]].min()
946946

947947
# Yearly seasonality
948948
yearly_disable = last - first < pd.Timedelta(days=730)

0 commit comments

Comments
 (0)