-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
sparse resampling not working with dictionary of columns? #15386
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
You want to be using
To re-purpose this issue - not sure when, but In [149]: %timeit ts.groupby(partial(round, freq='3T')).agg({'value' : 'sum'})
100 loops, best of 3: 6.56 ms per loop
In [150]: %timeit ts.groupby(ts.index.round('3T')).agg({'value' : 'sum'})
1000 loops, best of 3: 1.83 ms per loop |
@chris-b1 thanks! but the syntax for the regular
seems to work correctly |
To be honest I had no idea that worked, I think |
Hello there,
Have I said that Pandas is awesome? yes, many times ;-)
I have a question, I am working with a very large dataframe of trades, timestamped at the millisecond precision. Latest Pandas 19.2 here.
I need to resample the dataframe every
200 ms
, but given that my data spans several years and I am only interested in resampling data between10:00 am
and12:00 am
every day (handled bybetween_time()
), using a plainresample
will crash and burn my machine.Instead, I tried the
sparse resampling
shown in the http://pandas.pydata.org/pandas-docs/stable/timeseries.html#sparse-resampling, but it fails when i provide it with a dictionary of columns.Is that expected? Is it a bug?
Problem is: I need to resample several columns at once in my dataframe, eventually using different functions (
sum
,mean
,max
). Is anything wrong here?Thanks~
The text was updated successfully, but these errors were encountered: