Series pct_change fill_method behavior #25006
Labels
Algos
Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff
Enhancement
Missing-data
np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Hello,
After recently updating my version, I noticed a change in behavior of pct_change with missing data. This is related to #19873 .
First example without fill_method is as expected. The second example is the result now and the third is what it used to be. I think the user should be able to choose if she prefers the second or third behavior. I agree that the second example is correct, as it forward fills as expected, but if the time series is a stock price for example, returns on missing days (holidays) were not 0, which can bias some statistics.
I would suggest adding a new parameter, like skipna. I could not find any solution with existing parameters, if I missed something please let me know.
Thanks
The text was updated successfully, but these errors were encountered: