title: pandas check if two values are statistically different
body: <p>I have a pandas dataframe which has some values for Male and some for Female. I would like to calculate if the percentage of both genders' values is <strong>significantly different or not and tell confidence intervals of these rates</strong>. Given below is the sample code:</p>
  <pre><code>data={}
  data['gender']=['male','female','female','male','female','female','male','female','male']
  data['values']=[10,2,13,4,11,8,14,19,2]
  df_new=pd.DataFrame(data)
  df_new.head()   # make a simple data frame
  
  
      gender  values
  0   male    10
  1   female  2
  2   female  13
  3   male    4
  4   female  11
  
  df_male=df_new.loc[df_new['gender']=='male']
  df_female=df_new.loc[df_new['gender']=='female']   # separate male and female
  
  # calculate percentages
  male_percentage=sum(df_male['values'].values)*100/sum(df_new['values'].values)
  female_percentage=sum(df_female['values'].values)*100/sum(df_new['values'].values)
  
  # want to tell whether both percentages are statistically different or not and what are their confidence interval rates
  print(male_percentage)
  print(female_percentage)
  </code></pre>
  <p>Any help will be much appreciated. Thanks!</p>