title: Python statistics module returns different standard deviation than calculated
body: <p>I have a list of numbers that I would like to calculate the standard deviation of. I calculated the value using two different methods: 1. using the Python statistics module and 2. using the formula for standard deviation. The result is two different, but somewhat close numbers. Is there something different about how the statistics module calculates standard deviation or is this something to do with my coded calculation? I am also unaware how math.sqrt() works internally, but I assume it uses some type of approximation.</p>
  
  <pre><code>import statistics
  import math    
  
  def computeSD_S(variable):
      # Open the file and read the values in the column specified
      var_list = openAndReadVariable(variable)
      # Try to compute the median using the statistics module and print an error if a string is used as input
      try:
          st_dev = statistics.stdev(var_list)
          return st_dev
      except TypeError:
          return 'Variable values must be numerical.'
  
  def computeSD_H(variable):
      # Open the file and read the values in the column specified
      var_list = openAndReadVariable(variable)
      sum = 0
      # Try to compute the standard deviation using this formula and print an error if a string is used as input
      try:
          # Find the mean
          mean = statistics.mean(var_list)
          # Sum the squared differences
          for obs in var_list:
              sum += (obs-mean)**2
          # Take the square root of the sum divided by the number of observations
          st_dev = math.sqrt(sum/len(var_list))
          return st_dev
      except TypeError:
          return 'Variable values must be numerical.'
  
  variable = 'Total Volume'
  st_dev = computeSD_S(variable)
  print('Standard Deviation', st_dev)
  st_dev = computeSD_H(variable)
  print('Standard Deviation', st_dev)
  </code></pre>
  
  <p>Resulting Output:</p>
  
  <pre><code>Standard Deviation 3453545.3553994712
  Standard Deviation 3453450.731237387
  </code></pre>
  
  <p>In addition to computing the mean using the statistics module, I also computed the mean by hand and received the same results.</p>