auto_convert_to_rle(df: pandas.core.frame.DataFrame, threshold: Optional[float] = None) → pandas.core.frame.DataFrame¶
Auto-convert given DataFrame to RLE compressed DataFrame.
Datetime columns are currently not compressed due to pandas not supporting them.
Please note that RLE can, under some circumstances, require MORE memory than the uncompressed data. It is not advisable to set
thresholdto a value larger than 1 except for testing purposes.
df – Input DataFrame, may already contain RLE columns. This input data MIGHT not be copied!
Compression threshold, e.g.:
None: compress all
1.0compresses only if RLE does NOT take up more space
0.5compresses if at least 50% memory are safed
0.0do not compress at all
ValueError – If threshold is negative.