api: plan for narwhals.stable.v2
#1657
MarcoGorelli
announced in
Announcements
Replies: 1 comment 2 replies
-
I think I'd also like to remove row-order-dependent expressions:
- arg_max
- arg_min
- cum_count
- cum_max
- cum_min
- cum_prod
- cum_sum
- diff
- drop_nulls
- ewm_mean
- filter
- gather_every
- head
- is_first_distinct
- is_last_distinct
- mode
- rolling_mean
- rolling_std
- rolling_sum
- rolling_var
- sample
- shift
- sort
- unique
These can all stay available for All of these would of course stay available in In #1689 (comment), we find:
So, it would take more planning to be able to do this safely Example (maybe?) of how def shift_by(expr, by):
idx = pl.arg_sort_by(by)
return pl.col(expr).gather(idx).shift().sort_by(idx) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I think we can aim for
narwhals.stable.v2
some time in 2025The main things I'd like to achieve are:
Series
and have a defined row order (pandas, polars.DataFrame, pyarrow.Table, modin.DataFrame, cudf.DataFrame)collect
, adding/removing/subsetting columns, filtering rows. Initially, at least, row-order-dependent operations (such asnw.cum_sum
) will be left out. This will include Polars.LazyFrame, DuckDBPyRelation, pyspark.DataFrame, ibis.Table, dask.DataFrameCandidate changes:
from_native
. It will get simpler once we remove interchange-level things, but it's still fairly complicated. Not sure how much I like it to be completely honest, but I also haven't come up with anything betterUsage of
narwhals.stable.v1
should remain unaffectedTentative date: March 2025
Beta Was this translation helpful? Give feedback.
All reactions