Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

use functions to resample pandas

#We can also use custom functions and apply them when resampling using the .apply(method_name) method
#This is an example used in a downsampling example
def custom_resampler(arraylike):
    return np.sum(arraylike) + 5
data.resample('Q').apply(custom_resampler)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #functions #resample #pandas
ADD COMMENT
Topic
Name
7+8 =