DataFrame.asfreq()

pandas.DataFrame.asfreq

DataFrame.asfreq(freq, method=None, how=None, normalize=False) [source]

Convert TimeSeries to specified frequency.

Optionally provide filling method to pad/backfill missing values.

Parameters:

freq : DateOffset object, or string

method : {‘backfill’/’bfill’, ‘pad’/’ffill’}, default None

Method to use for filling holes in reindexed Series (note this does not fill NaNs that already were present):

  • ‘pad’ / ‘ffill’: propagate last valid observation forward to next valid
  • ‘backfill’ / ‘bfill’: use NEXT valid observation to fill

how : {‘start’, ‘end’}, default end

For PeriodIndex only, see PeriodIndex.asfreq

normalize : bool, default False

Whether to reset output index to midnight

Returns:

converted : type of caller

Notes

To learn more about the frequency strings, please see this link.

© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
http://pandas.pydata.org/pandas-docs/version/0.19.2/generated/pandas.DataFrame.asfreq.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部