Skip to content

Basic example of t-test on a polars dataframe #98

Answered by e10v
rosmur asked this question in Q&A
Discussion options

You must be logged in to vote

Since version 0.3.0 it's possible to pass Polars dataframes to tea-tasting directly:

import polars as pl
import tea_tasting as tt


data = pl.from_pandas(tt.make_users_data(seed=42))
print(data)
#> ┌──────┬─────────┬──────────┬────────┬───────────┐
#> │ user ┆ variant ┆ sessions ┆ orders ┆ revenue   │
#> │ ---  ┆ ---     ┆ ---      ┆ ---    ┆ ---       │
#> │ i64  ┆ u8      ┆ i64      ┆ i64    ┆ f64       │
#> ╞══════╪═════════╪══════════╪════════╪═══════════╡
#> │ 0    ┆ 1       ┆ 2        ┆ 1      ┆ 9.166147  │
#> │ 1    ┆ 0       ┆ 2        ┆ 1      ┆ 6.434079  │
#> │ 2    ┆ 1       ┆ 2        ┆ 1      ┆ 7.943873  │
#> │ 3    ┆ 1       ┆ 2        ┆ 1      ┆ 15.928675 │
#> │ 4    ┆ 0   …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@rosmur
Comment options

@e10v
Comment options

e10v Nov 19, 2024
Maintainer

Comment options

You must be logged in to vote
0 replies
Answer selected by e10v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants