In setup_dataframe line 250 of forecaster.py:
df = df.sort_values('ds')
df.reset_index(inplace=True, drop=True)
If df contains index and column with same name the following warning is generated:
fbprophet/forecaster.py:250: FutureWarning: 'ds' is both an index level and a column label.
Defaulting to column, but this will raise an ambiguity error in a future version
Warning (and future issue) can be solved by putting either of the following lines before the sorting:
df.index.name = Nonedf = df.rename_axis(None)reset_index before and after the call to sort_valuesThanks for identifying this, there are a few FutureWarnings popping up with the latest pandas that we'll have to go through and clean up for the next version.
I can open a PR later today if you tell me which approach you prefer better (out of those I listed or something else)
On Mar 18, 2019, at 1:14 PM, Ben Letham notifications@github.com wrote:
Thanks for identifying this, there are a few FutureWarnings popping up with the latest pandas that we'll have to go through and clean up for the next version.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
That'd be great, I don't have a preference for the approach.
Actually I haven't been able to produce this, how did you run into it?
If your pandas dataframe df has a timestamp column ds (which is what prophet expect) and you call df.resample(..., on=‘ds’) before passing the df to prophet ds becomes an index too.
So the problem is how data is manipulated before passing it to prophet, because prophet does not clean it up when setting up the df for internal use.
On May 13, 2019, at 3:18 PM, Ben Letham notifications@github.com wrote:
Actually I haven't been able to produce this, how did you run into it?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
is there a work around for this currently?
@t3ja does df.index.name = None before passing the data into prophet do it?
Can I work on this issue,if its not closed yet ?
I am sorry I didn’t follow up on this sooner.
Setting the index name to None works, but maybe you want to wait to see if Facebook devs want the change within prophet or let it be on the user.
IMO it is alright as it is literally a one line change.
On Jul 17, 2019, at 3:55 AM, Shahul Es notifications@github.com wrote:
Can I work on this issue,if its not closed yet ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
A change inside prophet I think would make sense.
I hope it was ok to pick this up @maverick100 @whitehatty
Absolutely, I had completely forgot about it
On Aug 29, 2019, at 6:03 AM, froessler notifications@github.com wrote:
I hope it was ok to pick this up @maverick100 @whitehatty
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
df.index.name = None, works fine .thanks @bletham bletham
Fix is now pushed to PyPI
Most helpful comment
@t3ja does
df.index.name = Nonebefore passing the data into prophet do it?