title: stdtr in python giving nan for p-value while doing t-test
body: <p>I am using the following code to perform t-test: </p>
  
  <pre><code>def t_stat(na,abar,avar,nb,bbar,bvar):
       logger.info("T-test to be performed")
       logger.info("Set A count = %f mean = %f variance = %f" % (na,abar,avar))
       logger.info("Set B count = %f mean = %f variance = %f" % (nb,bbar,bvar))
       adof = na - 1
       bdof = nb - 1
       logger.info("Degrees of Freedom of a=%f" % adof)
       logger.info("Degrees of Freedom of b=%f" % bdof)
       tf = (abar - bbar) / np.sqrt(avar/na + bvar/nb)
       dof = (avar/na + bvar/nb)**2 / (avar**2/(na**2*adof) + bvar**2/(nb**2*bdof))
       logger.info("tf = %f, dof=%f"%(tf,dof))
       pf = 2*stdtr(dof, -np.abs(tf))
  </code></pre>
  
  <p>My output looks like :</p>
  
  <pre><code>     Set A count = 3547465.000000 mean = 0.001123 variance = 0.000369
       Set B count = 83759692.000000 mean = 0.001242 variance = 0.000424
       Degrees of Freedom of a=3547464.000000
       Degrees of Freedom of b=83759691.000000
       tf = -11.374250, dof=-2176568.362223
       formula:   t = -11.3743  p = nan
  </code></pre>
  
  <p>When I pass the same data as arrays and use the ttest_ind function, I get t = -11.374250  p = 0.000000.</p>
  
  <p>Why is my function giving p as nan ? Afaik, I cannot treat nan as 0. How can I understand the exact difference between my t_stat and ttest_ind ? Any help would be appreciated. </p>