-
Hello, I appreciate that you understand the importance of good documentation for tool adoption. Sorry if I am missing it, but is there are any basic examples of running a Student's t-test using a polars dataframe? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello, Thank you for your interest and for a good question. The easiest way is to create an Ibis Table from Polars DataFrame and then use it as input data. Example: import ibis
import polars as pl
import tea_tasting as tt
data = ibis.memtable(pl.from_pandas(tt.make_users_data(seed=42)))
experiment = tt.Experiment(
sessions_per_user=tt.Mean("sessions"),
orders_per_session=tt.RatioOfMeans("orders", "sessions"),
orders_per_user=tt.Mean("orders"),
revenue_per_user=tt.Mean("revenue"),
)
result = experiment.analyze(data)
print(result) P.S. First, I wanted to suggest using Polars as Ibis data backend: con = ibis.polars.connect({"users_data": pl.from_pandas(tt.make_users_data(seed=42))})
data = con.table("users_data") But it turned out that Ibis doesn't support window functions in Polars backend (tea-tasting uses them to calculate variance and covariance). I will have to work on that in future versions. |
Beta Was this translation helpful? Give feedback.
Hello,
Thank you for your interest and for a good question.
The easiest way is to create an Ibis Table from Polars DataFrame and then use it as input data. Example:
P.S. First, I wanted to suggest using Polars as Ibis data backend: