tidypolars
tidypolars copied to clipboard
Remove Tibble subclass and create `tp` or `r` namespace
We can use the extension API to create a custom namespace for tidypolars methods that work directly on polars DataFrames and Expressions.
Open to suggestions on whether to use tp
or r
as the namespace.
import polars as pl
from polars import col
import tidypolars as tp
df = pl.DataFrame({"x": range(3), "y": ["a", "a", "b"]})
(
df
.tp.arrange("x")
.tp.summarize(x_mean = col("x").tp.mean(),
_by = "y")
)