polars
polars copied to clipboard
Python: deprecate most indexing operations.
Which ones should we still allow?
Please keep the slicing operations. They are standard in Data Science since numpy. The easiest way to take every other row of a series or a dataframe is df[::2].
Moreover, it would be great to allow for negative steps in Series like series[::-1]. Currently, negative steps work fine for DataFrames but result in error for Series (probably a bug):
import polars as pl
sr = pl.Series(name='int', values=np.arange(10,20))
sr[::-1]
OverflowError: can't convert negative int to unsigned
I agree, I want to remove predicates in index notation. That should always be a filter imo.
I want to maintain support for slicing and selection by strings/index.
I think other cases can indeed be removed. Slicing operations were greatly improved in https://github.com/pola-rs/polars/pull/3904
I agree, I want to remove predicates in index notation. That should always be a
filterimo.I want to maintain support for slicing and selection by strings/index.
This is the status quo, so I think this can be closed.