赋值代码:
# 对Connection Type分组 并对temp累计求和
wsw['Connection Number'] = wsw.groupby(['Connection Type'])['temp'].cumsum()
之后控制台警告:
Try using .loc[row_indexer,col_indexer] = value instead
改为
wsw.loc[:, 'Connection Number'] = wsw.groupby(['Connection Type'])['temp'].cumsum()