Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings related to Pandas 2.1.0 #260

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

fstp
Copy link

@fstp fstp commented Aug 27, 2024

Hi,

Just updated the code to remove deprecation warnings for ffill() and stack() Pandas methods.

For more info related to these updates check the Pandas release notes:
https://pandas.pydata.org/docs/whatsnew/v2.1.0.html

image

image

/John

fstp added 3 commits August 27, 2024 14:46
When running zipline-reloaded with latest Pandas version the following
deprecation warning is shown: "DataFrame.fillna with 'method' is deprecated"

Simply replacing fillna() with the ffill() method directly works
and removes the warning.
In preparation for Pandas 3.0, a new and improved implementation of the stack() method was introduced.
There is a feature flag, future_stack, which, when set to True, enables the new implementation to be used.
If the flag is not set, a warning will be emitted.

More information about the implementation can be found here:
https://pandas.pydata.org/docs/whatsnew/v2.1.0.html

Crucially, the behavior regarding NA values has been improved. The new implementation will not create unnecessary
NA values, but instead, it will preserve them from the input without the need to use dropna=False. This change avoids
the potential issue of generating unnecessary NA values from multiple levels of stacking.
@fstp
Copy link
Author

fstp commented Oct 14, 2024

@stefan-jansen
Hi, sorry to bother you, but I just wanted to check if this would be okay to merge? 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant