flasc.data_processing.dataframe_manipulations.df_reduce_precision#
- flasc.data_processing.dataframe_manipulations.df_reduce_precision(df_in: DataFrame | FlascDataFrame, verbose: bool = False, allow_convert_to_integer: bool = True) DataFrame | FlascDataFrame [source]#
Reduce dataframe precision.
Reduce the precision in dataframes from float64 to float32, or possibly even further to int32, int16, int8 or even bool. This operation typically reduces the size of the dataframe by a factor 2 without any real loss in precision. This can make particular operations and data storage much more efficient. This can also bring about speed-ups doing calculations with these variables.
- Parameters:
df_in (pd.Dataframe | FlascDataFrame) -- Dataframe that needs to be reduced.
verbose (bool, optional) -- Print progress. Defaults to False.
allow_convert_to_integer (bool, optional) -- Allow reduction to integer type if possible. Defaults to True.
- Returns:
Reduced dataframe
- Return type:
pd.Dataframe | FlascDataFrame