I have a Polars DataFrame with a column named "*" and would like to reference just that column. When I try to use pl.col("*") it is interpreted as a wildcard for "all columns." Here's an example:
import polars as pl
df = pl.DataFrame({"A": [1, 2], "B": [3, None], "*": [4, 5]})
print(df.select(pl.col("*"))) # --> prints all columns
The documentation for pl.col doesn't include any recommendation on escaping the asterisk. My naive attempt at pl.col(r"\*") fails.
Edit:
There's a bit of XY problem here as my original underlying goal was to drop the "*" column with df.drop("*"), but I quickly realized that the call relied on the behavior of pl.col. jqurious correctly identified that goal in their answer.