normalize_ts_feature

czsc.normalize_ts_feature(df, x_col, n=10, **kwargs)[source]

对时间序列数据进行归一化处理

Parameters:
  • df – 因子数据,必须包含 dt, x_col 列,其中 dt 为日期,x_col 为因子值,数据样例:

  • x_col – 因子列名

  • n – 分层数量,默认为10

  • kwargs

    • method: 分层方法,expanding 或 rolling,默认为 expanding

    • min_periods: expanding 时的最小样本数量,默认为300

Returns:

df, 添加了 x_col_norm, x_col_qcut, x_col分层 列