skka3134

skka3134

email
telegram

3. Statistical Analysis

  1. Read data, specify time as the index, and convert time to standard format.
import pandas as pd
data=pd.read_csv('data.csv',index_col=0,parse_dates=True)

Analysis of sequence variations

  1. View the interpolation of the previous day.
data.diff()
  1. Average difference.
data.diff().mean()
  1. Growth rate.
data.pct_change().round(3)
  1. Average growth rate.
data.pct_change().mean()

Time series resampling

  1. By week.
data.resample('1w').last()
  1. By week, specify labels.
data.resample('1w',label='left').last()
  1. Time window.

Short-term average calculation.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.