Overview
A type casting function is developed (based on this link) to reduce the memory usage of a dataframe. However, using the function the statistical information is missing when using pd.describe() feature.
Steps to Reproduce
- Use the
pd.describe() method w/o any modifications, results in:

- Now, define/import
reduce_mem_usage
- Using the same function, the output is changed as:

Expected Behavior
Should be able to use all statistical features.
Actual Behavior
Direct describe function is not working, but using native numpy functions (like np.quantile(trn_data["f_00"], 0.95)) works.
Context
Python Version : 3.9
Operating System : Windows 10 (Version: 21H2, OS Build: 19044.1682)
Overview
A type casting function is developed (based on this link) to reduce the memory usage of a dataframe. However, using the function the statistical information is missing when using
pd.describe()feature.Steps to Reproduce
pd.describe()method w/o any modifications, results in:reduce_mem_usageExpected Behavior
Should be able to use all statistical features.
Actual Behavior
Direct
describefunction is not working, but using nativenumpyfunctions (likenp.quantile(trn_data["f_00"], 0.95)) works.Context
Python Version : 3.9
Operating System : Windows 10 (Version: 21H2, OS Build: 19044.1682)