Skip to content
Advertisement

Tag: pandas-apply

Apply T-Test test per group

I have dataframe like this: And i want to calculate p-value from T-Test for each variable between groups. I can manually calculate each p-value like this: So the question is how can i get a result dataframe like shown below for all variables automatically? Answer There are several ways, the core idea is to use groupby on the variable. Here

Advertisement