数据聚合 import pandas as pd from pandas import Series import numpy as np # 准备数据 df = pd.DataFrame([[-0.204708,1.393406,'a','one'], [0.478943,0.092908,'a','two'], [-0.519439,0.281746,'b','one'], [-0.555730,0.769023,'b','two'], [1.965781,1.246435,'a','one…