|
@@ -22,6 +22,8 @@ def cal_volt_uniform(dfin, volt_column, window=10, step=5, threshold=3):
|
|
|
# 电压偏离度
|
|
|
mean = df_volt_rolling.mean(axis=1)
|
|
|
std = df_volt_rolling.std(axis=1)
|
|
|
+ # mean = [np.array(sorted(x)[1:-1]).mean() for x in df_volt_rolling.values]
|
|
|
+ # std = [np.array(sorted(x)[1:-1]).std() for x in df_volt_rolling.values]
|
|
|
df_volt_rolling_norm = df_volt_rolling.sub(mean, axis=0).div(std,axis=0)
|
|
|
df_volt_rolling_norm = df_volt_rolling_norm.reset_index(drop=True)
|
|
|
return df_volt_rolling_norm, time_list
|
|
@@ -54,6 +56,8 @@ def cal_voltdiff_uniform(dfin, volt_column, window=10, step=5, window2=10, step2
|
|
|
time_list = time_list[window2-1::step2]
|
|
|
mean = df_voltdiff_rolling.mean(axis=1)
|
|
|
std = df_voltdiff_rolling.std(axis=1)
|
|
|
+ # mean = [np.array(sorted(x)[1:-1]).mean() for x in df_voltdiff_rolling.values]
|
|
|
+ # std = [np.array(sorted(x)[1:-1]).std() for x in df_voltdiff_rolling.values]
|
|
|
df_voltdiff_rolling_norm = df_voltdiff_rolling.sub(mean, axis=0).div(std,axis=0)
|
|
|
df_voltdiff_rolling_norm = df_voltdiff_rolling_norm.reset_index(drop=True)
|
|
|
return df_voltdiff_rolling_norm, time_list
|