Skip to content
Discussion options

You must be logged in to vote

Hi @ozgurkalan, regular expression based selectors are already implemented as s.matches:

In [3]: from ibis.interactive import *

In [4]: t = ibis.examples.penguins.fetch()

In [5]: t.columns
Out[5]:
['species',
 'island',
 'bill_length_mm',
 'bill_depth_mm',
 'flipper_length_mm',
 'body_mass_g',
 'sex',
 'year']

In [6]: t.select(s.matches("^bill_"))
Out[6]:
┏━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ bill_length_mm ┃ bill_depth_mm ┃
┡━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ float64        │ float64       │
├────────────────┼───────────────┤
│           39.1 │          18.7 │
│           39.5 │          17.4 │
│           40.3 │          18.0 │
│            nan │           nan │
│           36.7 │   …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by cpcloud
Comment options

You must be logged in to vote
1 reply
@cpcloud
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants