Skip to content

Commit

Permalink
0.9.32 update
Browse files Browse the repository at this point in the history
  • Loading branch information
zengbin93 committed Oct 14, 2023
1 parent f4c5b60 commit b39f536
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions czsc/utils/st_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def show_symbol_factor_layering(df, x_col, y_col='n1b', **kwargs):

if df[x_col].nunique() > n:
df[f'{x_col}分层'] = pd.qcut(df[x_col], q=n, labels=False, duplicates='drop')
df[f'{x_col}分层'] = df[f'{x_col}分层'].apply(lambda x: f'第{str(x+1).zfill(2)}层')
else:
# 如果因子值的取值数量小于分层数量,直接使用因子独立值排序作为分层
x_rank = sorted(df[x_col].unique())
Expand Down

0 comments on commit b39f536

Please sign in to comment.