Cut pandas Memory and Speed Up groupby with Categorical Dtypes
Repeated string columns waste RAM and slow down aggregations. Converting them to pandas Categorical stores unique values once and uses integer codes, cutting memory and speeding up groupby.