-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
asfreq() issue with 'method' parameter #9963
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
Comments
pls provide an example and |
Hello jreback,
Here's an example. The original data are contained in this DataFrame
Notice that "Friday, 10th April" is missing. Now,
As you can see forward filling took place only for the missing Friday. Thanks again, |
|
Thanks for your reply, As you also noticed filling occurs only for NaN generated by imposing the new frequency and not on original missing data. My personal opinion is that this behaviour should be highlighted in the documentation, otherwise one may assume that all holes/NaN are filled. Umberto |
Hi all,
I've noticed the following behaviour in .asfreq method when dealing with frames/series containing original NaN values. When calling for instance asfreq('W-FRI',method='ffill') only NaN generated by DateOffset are forward filled, while the already present NaN values are not treated. I'm trying to figure out whether this was an intentional feature or a bug. In the former case however I would say that the documentation is a bit misleading
http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.asfreq.html
Indeed, the description of parameter 'method' is exactly equivalent to that present in fillna,
http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.fillna.html
so it comes natural to expect all invalid observations be filled.
Thanks for your help,
Umberto
The text was updated successfully, but these errors were encountered: