polars.Series.shrink_dtype
-
Сокращает числовые столбцы до минимально необходимого типа данных.
Сужает тип данных до необходимого для представления экстремальных значений этого [
Series]. Это можно использовать для снижения нагрузки на память.Примеры
>>> s = pl.Series("a", [1, 2, 3, 4, 5, 6]) >>> s shape: (6,) Series: 'a' [i64] [ 1 2 3 4 5 6 ] >>> s.shrink_dtype() shape: (6,) Series: 'a' [i8] [ 1 2 3 4 5 6 ]
Series.shrink_dtype() → Series
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/series/api/polars.Series.shrink_dtype.html