Python ValueError:操作数无法与形状(7410,)(3,)一起广播

Python ValueError:操作数无法与形状(7410,)(3,)一起广播,python,pandas,pandas-groupby,Python,Pandas,Pandas Groupby,我有以下格式的df: Priority Mined_Category server date_reported Count Zscore_Volume 1 - Critical Memory issue xxxxxx111 2018-07-11 1 nan 1 - Critical Memory issue xxxxxx111 2018-08-11 1 nan 1 - Criti

我有以下格式的df:

    Priority Mined_Category           server date_reported  Count Zscore_Volume
1 - Critical   Memory issue        xxxxxx111    2018-07-11      1      nan
1 - Critical   Memory issue        xxxxxx111    2018-08-11      1      nan
1 - Critical   Memory issue        yyyyyy195    2018-07-06      1      1.71
1 - Critical   Memory issue        yyyyyy195    2018-07-08      1      1.71
    2 - High   Memory issue  abcabcabcba1410    2018-08-21      1     nan
我的目标是每当
优先级
挖掘的\u类别
服务器
分组计数为1时,将nan替换为100,每当
优先级
挖掘的\u类别
服务器
分组计数为1时,将nan替换为1000

我尝试了以下代码:

> df_aggegrate_Volume.loc[(df_aggegrate_Volume.groupby(["Priority","Mined_Category","server"]).count()>1)&(df_aggegrate_Volume['Zscore_Volume'].isnull()) ,"Zscore_Volume"]= -100
但我得到以下错误:

ValueError:操作数无法与形状一起广播 (7410)(3)

需要返回与原始
df
大小相同的
系列
,由聚合值填充:

m1 = (df_aggegrate_Volume.groupby(["Priority","Mined_Category","server"])["server"]
                         .transform('count')>1)

m2 = df_aggegrate_Volume['Zscore_Volume'].isnull()

df_aggegrate_Volume.loc[m1 & m2 ,"Zscore_Volume"]= -100

print (df_aggegrate_Volume)
       Priority Mined_Category           server date_reported  Count  \
0  1 - Critical   Memory issue        xxxxxx111    2018-07-11      1   
1  1 - Critical   Memory issue        xxxxxx111    2018-08-11      1   
2  1 - Critical   Memory issue        yyyyyy195    2018-07-06      1   
3  1 - Critical   Memory issue        yyyyyy195    2018-07-08      1   
4      2 - High   Memory issue  abcabcabcba1410    2018-08-21      1   

   Zscore_Volume  
0        -100.00  
1        -100.00  
2           1.71  
3           1.71  
4            NaN