Data Analysis 14 - Time Series in Pandas

Preface: In date processing, some functions use corresponding time symbols to represent time. The common symbols are as follows:

insert image description here

sequentially

  • generate time series
    • Code: pd.date_range(start='2021-01-01', end='2021-01-31', freq='5D') # start: 2021-01-01, end: 2021-01-31, interval 5 days
    • Parameters: start: start date; end: end date; freq: time frequency; periods: number of generated periods
  • time series addition and subtraction
    • example
      insert image description here
  • time forward (future) offset
    insert image description here
  • Time offset backwards (in the past)
    insert image description here
  • instantiation date
    • Function: The instantiated date can use some date processing methods that come with python
    • Example:
      insert image description here

Guess you like

Origin blog.csdn.net/sz1125218970/article/details/130784177