v0.17.0
Breaking changes
- Updated rust-polars to unreleased version (> 0.40.0) (#1104, #1110, #1117, #1124):
- In
$join()
, there is a new argumentcoalesce
and thehow
options now accept"full"
instead of"outer"
and"outer_coalesce"
. $top_k()
and$bottom_k()
gain three argumentsnulls_last
,maintain_order
andmultithreaded
.- All
$rolling_*()
functions lose the argumentsby
,closed
andwarn_if_unsorted
. Rolling computations based onby
must be made via the correspondingrolling_*_by()
, e.grolling_mean_by()
instead ofrolling_mean(by =)
(#1115). pl$scan_parquet()
andpl$read_parquet()
gain an argumentglob
which defaults toTRUE
. Set it toFALSE
to avoid considering*
as a globing pattern.$is_not_nan()
on anull
value (NA
in R) now returnsnull
. Previously, it returnedTRUE
.- In
$reshape()
, argumentdims
is renameddimensions
and there is a new argumentnested_type
specifying if the output should be of type List or Array. - In
$value_counts()
, all arguments must be named and there is a new argumentname
to specify the name of the output. - In all functions accepting optimization parameter (such as
projection_pushdown
), there is a new parametercluster_with_columns
to combine sequential independent calls to$with_columns()
. $str$explode()
is removed.- The
check_sorted
argument is removed from$rolling()
and$group_by_dynamic()
. Sortedness is now verified in a quick manner, so this argument is no longer needed (pola-rs/polars#16494). $name$map()
stacks on Linux, so this method is deprecated and the document is removed. Please use other methods like<LazyFrame>$rename(<function>)
instead (#1123).
- In
- As warned in v0.16.0, the order of arguments in
pl$Series
is changed (#1071). The first argument is nowname
, and the second argument isvalues
. $to_struct()
on an Expr is removed. This method is now only available forSeries
,DataFrame
, and in the$list
and$arr
subnamespaces. For example,pl$col("a", "b", "c")$to_struct()
should be replaced withpl$struct(c("a", "b", "c"))
(#1092).pl$Struct()
now only accepts named inputs and objects of classRPolarsField
. For example,pl$Struct(pl$Boolean)
doesn't work anymore and should be named likepl$Struct(a = pl$Boolean)
(#1053).- In
$all()
and$any()
, the argumentdrop_nulls
is renamedignore_nulls
, and this argument must be named (#1050). - New method
$struct$with_fields()
(#1109) and new functionpl$field()
to be used in expressions in$struct$with_fields()
(#1113). - New methods for
RPolarsDataType
:$is_enum()
,$is_categorical()
,$is_known()
,$is_string()
,$contains_views()
,$contains_categorical()
(#1112). - In
$dt$combine()
, the argumentstm
andtu
are renamedtime
andtime_unit
(#1116). - The default value of the
rechunk
argument ofpl$concat()
is changed fromTRUE
toFALSE
(#1125). - In
$rename()
for LazyFrame and DataFrame, key-value pairs of names are changed toold_name = "new_name"
instead ofnew_name = "old_name"
(#1129). - In
$rename()
for LazyFrame and DataFrame, no argument is not allowed (#1129). - In all
$rolling_*()
functions, the argumentscenter
andddof
must be named (#1115).
New features
- Allow specify a function in
$rename()
for LazyFrame and DataFrame. They are equivalent topolars.LazyFrame.rename(mapping: Callable[[str], str])
orpolars.DataFrame.rename(mapping: Callable[[str], str])
in Python Polars (#1122, #1129).
Full Changelog: v0.16.4...v0.17.0