File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -355,6 +355,36 @@ def freqstr(self):
355
355
return self .freq
356
356
357
357
def asfreq (self , freq = None , how = 'E' ):
358
+ """
359
+ Convert the PeriodIndex to the specified frequency `freq`.
360
+
361
+ Parameters
362
+ ==========
363
+
364
+ freq: str; a frequency
365
+ how: str; {'E', 'S'}
366
+ 'E', 'END', or 'FINISH' for end,
367
+ 'S', 'START', or 'BEGIN' for start.
368
+
369
+ Returns
370
+ =======
371
+ new: PeriodIndex with the new frequency
372
+
373
+ Examples
374
+ ========
375
+
376
+ >>> pidx = pd.datejjk
377
+ >>> pidx.asfreq('M')
378
+ <class 'pandas.tseries.period.PeriodIndex'>
379
+ [2010-12, ..., 2015-12]
380
+ Length: 6, Freq: M
381
+
382
+ >>> pidx.asfreq('M', how='S')
383
+ Out[3]:
384
+ <class 'pandas.tseries.period.PeriodIndex'>
385
+ [2010-01, ..., 2015-01]
386
+ Length: 6, Freq: M
387
+ """
358
388
how = _validate_end_alias (how )
359
389
360
390
freq = frequencies .get_standard_freq (freq )
You can’t perform that action at this time.
0 commit comments