-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
passing np.std to resample does not actually call the numpy function #3844
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
i believe the method name is looked up and so it calls the pandas version...marking as a bug |
@jreback i think it's a bit magical to look up |
Do it this way, the std is defined as is, to get another behavior, you need to provide a custom function
|
@cpcloud this is not a bug |
oh ok my bad... |
@cpcloud well there is a bug somewhat related This should work I think, something screwy here
|
yep this is the thing i brought up in @jsudheer's last issue. right, i always forget about nans because pandas handles them so gracefully most of the time and so i just don't have to think about it or i have to use the stupid nan* functions (most only in scipy) or used masked arrays :'( |
@cpcloud actually this is the only case where it fails (when its a single day), so its a bug, but edge case (e.g. when crossing multiple days it works) |
So even if we call how=np.std it does the pandas std? ie how=std and On Tue, Jun 11, 2013 at 7:50 PM, jreback [email protected] wrote:
with best regards Sudheer Dr. Sudheer Joseph Scientist INDIAN NATIONAL CENTRE FOR OCEAN INFORMATION SERVICES (INCOIS)
|
that is a feature, most numpy routines are NOT nan-safe (and slower) than pandas routines you can also get tthe results you want by doing this. As I said many times, you should just define a function of your own (which is what this lambda is), then you can control exactly what you get
|
Thank you, On Tue, Jun 11, 2013 at 9:04 PM, jreback [email protected] wrote:
with best regards Sudheer Dr. Sudheer Joseph Scientist INDIAN NATIONAL CENTRE FOR OCEAN INFORMATION SERVICES (INCOIS)
|
np....if you can think of places in the docs where things are not clear let us know! |
Is this the doc or there are others Also from below statement, I was expecting I will get std with 15 days and 2006-08-31 28.765038 ts.groupby(pd.TimeGrouper('M',closed='center',label='center')).apply(lambda I expected
with best regards Sudheer Dr. Sudheer Joseph Scientist INDIAN NATIONAL CENTRE FOR OCEAN INFORMATION SERVICES (INCOIS)
|
http://pandas.pydata.org/pandas-docs/dev/timeseries.html you are doing something subtle, so you really need to read and understand the docs |
Thank you,
with best regards Sudheer Dr. Sudheer Joseph Scientist INDIAN NATIONAL CENTRE FOR OCEAN INFORMATION SERVICES (INCOIS)
|
The text was updated successfully, but these errors were encountered: