mwaskom / seaborn

Statistical data visualization in Python
https://seaborn.pydata.org
BSD 3-Clause "New" or "Revised" License
12.5k stars 1.92k forks source link

Consider adding regex or wildcard specification of variables in Plot.pair #2975

Open mwaskom opened 2 years ago

mwaskom commented 2 years ago

e.g.

Plot(penguins, y="body_mass_g").pair(x="bill_")

or

Plot(penguins, y="body_mass_g").pair(x=".+_mm$")

One question: regex matching or some simpler glob-style wildcard matching, perhaps with a negation operator? (e.g. x=!bill_*")

Regex is more flexible but trickier to work with for some common applications in this application (i.e., anti-match on a common prefix). Regex is maybe marginally less familiar to people, but still probably the way to go.

Rabeez commented 2 years ago

For what it's worth I've had to make similar charts (usually scatter matrices) where I had to drop some columns like ID, dates so a built-in 'negation' will be helpful.

Also, even if regex is overall less familiar to people it is a standard known syntax (with many debug resources) which should simplify adoption in long term.