resample doesn't support `.aggregate`
See original GitHub issueIn [308]: s # pandas series
Out[308]:
2000-01-01 00:00:00 0
2000-01-01 00:01:00 1
2000-01-01 00:02:00 2
2000-01-01 00:03:00 3
2000-01-01 00:04:00 4
2000-01-01 00:05:00 5
2000-01-01 00:06:00 6
2000-01-01 00:07:00 7
2000-01-01 00:08:00 8
Freq: T, dtype: int64
In [309]: s.resample('2min').aggregate('asfreq')
Out[309]:
2000-01-01 00:00:00 0
2000-01-01 00:02:00 2
2000-01-01 00:04:00 4
2000-01-01 00:06:00 6
2000-01-01 00:08:00 8
Freq: 2T, dtype: int64
In [310]: dd.from_pandas(s, 2).resample('2min').aggregate('asfreq')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-310-3b266d1c3122> in <module>()
----> 1 dd.from_pandas(s, 2).resample('2min').aggregate('asfreq')
AttributeError: 'Resampler' object has no attribute 'aggregate'
@jcrist I think you’re the resampling guru?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Pandas named aggregation not working with resample agg
It's a bug. Solved in pandas >=1.4.0 . Try workaround for <1.4.0: func = None. .agg(func = None, open=pd.NamedAgg("trade_price", "first") .
Read more >pandas.core.resample.Resampler.aggregate
Functions that mutate the passed object can produce unexpected behavior or errors and are not supported. See Mutating with User Defined Function (UDF)...
Read more >How can I both resample and aggregate a raster using Terra?
You can first resample to a high resolution raster that is aligned with the low resolution raster and then use aggregate. Example data:...
Read more >Using the Pandas “Resample” Function - Towards Data Science
This argument does not change the underlying calculation, it just relabels the output based on the desired edge once the aggregation is ...
Read more >Pandas Resample – pd.df.resample() - Data Independent
Pandas Resample is an amazing function that does more than you think. This powerful tool will help you transform and clean up your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure, aggregate could be added. Will probably get to it later today. If all you’re looking for is
.agg('asfreq')
, I’m pretty sure that’s equivalent to.first()
(which is currently implemented).I am closing this since it is about
agg
on resample which is on latest dask.