machow / siuba

Python library for using dplyr like syntax with pandas and SQL
https://siuba.org
MIT License
1.14k stars 48 forks source link

fix: support negative index, multislice in tidyselect #430

Closed machow closed 2 years ago

machow commented 2 years ago

Fix tidyselect to support:

from siuba.data import mtcars
from siuba import _, select

# negative indexing
select(mtcars, -1)

# integers in extended slice syntax
select(mtcars, _[0, 1])

Additionally, negating in any position used to be treated as triggering an implicit everything(). Now, only a negation in the first position does that (consistent with R tidyselect)

Notes: