freqm if you have an array of stringsyou can also appeal to the periodindex class itselfin [ ]values [' '' '' 'in [ ]index pd periodindex(valuesfreq=' -dec'in [ ]index out[ ]freqq-dec [ length period frequency conversion periods and periodindex objects can be converted to another frequency using their asfreq method as an examplesuppose we had an annual period and wanted to convert it into monthly period either at the start or end of the year this is fairly straightforwardin [ ] pd period(' 'freq=' -dec'in [ ] asfreq(' 'how='start'out[ ]period(' - '' 'in [ ] asfreq(' 'how='end'out[ ]period(' - '' 'you can think of period(' '' -dec'as being cursor pointing to span of timesubdivided by monthly periods see figure - for an illustration of this for fiscal year ending on month other than decemberthe monthly subperiods belonging are differentin [ ] pd period(' 'freq=' -jun'in [ ] asfreq(' ''start'out[ ]period(' - '' 'in [ ] asfreq(' ''end'out[ ]period(' - '' 'when converting from high to low frequencythe superperiod will be determined depending on where the subperiod "belongsfor examplein -jun frequencythe month aug- is actually part of the periodin [ ] pd period(' - '' 'in [ ] asfreq(' -jun'out[ ]period(' '' -jun'whole periodindex objects or timeseries can be similarly converted with the same semanticsin [ ]rng pd period_range(' '' 'freq=' -dec'in [ ]ts series(np random randn(len(rng))index=rngin [ ]ts time series www it-ebooks info