1. mean() 函數(shù)定義: numpy.mean(a, axis=None, dtype=None, out=None, keepdims=<class numpy._globals._NoValue at 0x40b6a26c>)[source] Compute the arithmetic mean along the specified axis. Returns the average of the
從結(jié)果看到在列方向group分組 執(zhí)行聚合函數(shù)mean()后列索引就只有 blue和red了。 整個過程可以這么理解 在列方向上進行分組 a b e為一組為red,c d 為一組為blue。最后以red blue作為新DataFraem的列索引 同樣Series也有同樣的功能,它可以被看作一個固定大小的映射。對于上面的那個例子,如果用series作為分組鍵,...