on wednesdayto -fri is neither upsampling nor downstampling pandas objects are equipped with resample methodwhich is the workhorse function for all frequency conversionin [ ]rng pd date_range(''periods= freq=' 'in [ ]ts series(randn(len(rng))index=rngin [ ]ts resample(' 'how='mean'out[ ] freqm in [ ]ts resample(' 'how='mean'kind='period'out[ ] - - - - freqm resample is flexible and high-performance method that can be used to process very large time series 'll illustrate its semantics and use through series of examples table - resample method arguments argument description freq string or dateoffset indicating desired resampled frequencye ' '' min'or sec ond( how='meanfunction name or array function producing aggregated valuefor example 'mean''ohlc'np max defaults to 'meanother common values'first''last''median''ohlc''max''minaxis= axis to resample ondefault axis= fill_method=none how to interpolate when upsamplingas in 'ffillor 'bfillby default does no interpolation closed='rightin downsamplingwhich end of each interval is closed (inclusive)'rightor 'leftdefaults to 'rightlabel='rightin downsamplinghow to label the aggregated resultwith the 'rightor 'leftbin edge for examplethe : to : -minute interval could be labeled : or : defaults to 'right(or : in this exampleloffset=none time adjustment to the bin labelssuch as '- ssecond(- to shift the aggregate labels one second earlier limit=none when forward or backward fillingthe maximum number of periods to fill resampling and frequency conversion www it-ebooks info