79804256

Date: 2025-10-29 22:02:09
Score: 0.5
Natty:
Report link

I used a regular expression to solve this issue. In Polars you signal regular expressions with the start and end symbols ^ and $ and the * needs to be escaped so the full solution looks like

python
import polars as pl
df = pl.DataFrame({"A": [1, 2], "B": [3, None], "*": [4, 5]})
print(df.select(pl.col(r"^\*$")))  # --> prints only the "*" column
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Sam