Remove empty DataFrames from pandas resample object

Viewed 1480

I have a pandas DataFrame df with time lapses which may be longer than 30 minutes. I wish to resample it

r = df.resample('30T')

and then to apply some aggregation:

r.apply(my_fancy_aggregation)

my_fancy_aggregation can NOT work on empty array_likes.

How do I clean r from the empty aggregates BEFORE applying my_fancy_aggregation?

2 Answers
Related