I use Pandas GroupBy and Groupby.agg by using functions such as sum, max and min for my numerical columns but I noticed that the data types I previously imposed to my columns (such as np.int8, np.int16, np.int32) are not preserved after the GroupBy aggregation and that actually every column is overcasted to int64.
Pandas version 1.1.5
My current solution is to just re-downcast once finished the groupby aggregation, is this a known issue and/or is there a nicer solution?