polars.DataFrame.shrink_to_fit

DataFrame.shrink_to_fit(in_place: Literal[False] = False) polars.internals.frame.DF
DataFrame.shrink_to_fit(in_place: Literal[True]) None
DataFrame.shrink_to_fit(in_place: bool) Optional[polars.internals.frame.DF]

Shrink memory usage of this DataFrame to fit the exact capacity needed to hold the data.