Skip to content

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? 👍

@stefan-jansen stefan-jansen merged commit 7d48b2c into stefan-jansen:main May 26, 2025
@fstp
Copy link
Author

fstp commented May 27, 2025

Thanks! 😊

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.

2 participants