title: Why does SciPy return `nan` for a t-test with samples with 0 variance?
body: <p>I am using <a href="http://en.wikipedia.org/wiki/SciPy" rel="nofollow">SciPy</a> in Python and the following return a <code>nan</code> value for whatever reason:</p>
  
  <pre><code>&gt;&gt;&gt;stats.ttest_ind([1, 1], [1, 1])
  Ttest_indResult(statistic=nan, pvalue=nan)
  
  &gt;&gt;&gt;stats.ttest_ind([1, 1], [1, 1, 1])
  Ttest_indResult(statistic=nan, pvalue=nan).
  </code></pre>
  
  <p>But whenever I use samples that have different summary statistics, I actually get a reasonable value:</p>
  
  <pre><code>stats.ttest_ind([1, 1], [1, 1, 1, 2])
  Ttest_indResult(statistic=-0.66666666666666663, pvalue=0.54146973927558495).
  </code></pre>
  
  <p>Is it reasonable to interpret a p-value of <code>nan</code> as <code>0</code> instead? Is there a reason from statistics that it doesn't make sense to run a 2-sample t-test on samples with the same summary statistics?</p>