Python package for this power analysis calculator I would like to use the following power analysis formula into a python notebook
https://clincalc.com/stats/samplesize.aspx
Any idea which python package would replicate the same results ?
Edit:
I tried the following function from statsmodel module but can't seem to get anything close to the numbers in the webpage. Also , the formula in the webpage doesn't require a standard deviation . Why ?
statsmodels.stats.power.tt_ind_solve_power¶


Because you're using 4 variants, this is a good case to just simulate power.  I'm finding that typical power calculations actually give smaller power when we simulate the experiments, which to me is a good reason to ignore formulae and calculators and just do it yourself.
So here is a small R script to do just that.  I'm going to simulate 4 exposures, three of which have a CTR of 0.005 and one of which has a CTR fo 0.0055.  I'll estimate the CTR after simulating the data and determine how frequently I reject the null as a function of the sample size
library(tidyverse)

sim<-function(N){
  r = replicate(10000, {
  p <- c(0.005, 0.005, 0.005, 0.0055)
  y <- rbinom(4, N, p)
  fit <- glm(cbind(y, N-y) ~ factor(1:4), family = binomial())
  s <- summary(fit)
  p.val <- s$coefficients['factor(1:4)4', 'Pr(>|z|)']
  
  p.val<0.05
})
  
  mean(r)
}

d = tibble(N = seq(300000, 400000, 10000))%>% 
  mutate(
    pwr = map_dbl(N, sim)
  )

d %>% 
  ggplot(aes(N, pwr))+
  geom_line()+
  scale_y_continuous(labels = scales::percent)+
  scale_x_continuous(labels = scales::comma)+
  labs(x='Sample Size (Per Group)',
       y = 'Power')




Show below is the estimated power curve for a two tailed test.  The code is easily edited to account for a one tailed test

Since the CTR is so small and proposed difference to detect is also very small, it looks like you're going to need 1.3 million users for this experiment.
