series and dataframe objects indexed by timestamps can be converted to periods using the to_period methodin [ ]rng pd date_range(''periods= freq=' 'in [ ]ts series(randn( )index=rngin [ ]pts ts to_period(in [ ]ts out[ ]- - freqm in [ ]pts out[ ] - - - - - freqm since periods always refer to non-overlapping timespansa timestamp can only belong to single period for given frequency while the frequency of the new periodindex is inferred from the timestamps by defaultyou can specify any frequency you want there is also no problem with having duplicate periods in the resultin [ ]rng pd date_range(''periods= freq=' 'in [ ]ts series(randn( )index=rngin [ ]ts to_period(' 'out[ ] - - - - - - - - - freqm to convert back to timestampsuse to_timestampin [ ]pts ts to_period(in [ ]pts out[ ] - - - - - freqm in [ ]pts to_timestamp(how='end'out[ ]- - freqm periods and period arithmetic www it-ebooks info