parameters: (self, k, M, n, N)
return_statement: return np.asarray(res)
docstring: More precise calculation, 1 - cdf doesn't cut it.
docstring_summary: More precise calculation, 1 - cdf doesn't cut it.
docstring_tokens: More precise calculation 1 - cdf doesn t cut it .
function: def _sf(self, k, M, n, N):
          """More precise calculation, 1 - cdf doesn't cut it."""
          # This for loop is needed because `k` can be an array. If that's the
          # case, the sf() method makes M, n and N arrays of the same shape. We
          # therefore unpack all inputs args, so we can do the manual
          # integration.
          res = []
          for quant, tot, good, draw in zip(k, M, n, N):
              # Manual integration over probability mass function. More accurate
              # than integrate.quad.
              k2 = np.arange(quant + 1, draw + 1)
              res.append(np.sum(self._pmf(k2, tot, good, draw)))
          return np.asarray(res)
function_tokens: def _sf ( self , k , M , n , N ) : # This for loop is needed because `k` can be an array. If that's the # case, the sf() method makes M, n and N arrays of the same shape. We # therefore unpack all inputs args, so we can do the manual # integration. res = [ ] for quant , tot , good , draw in zip ( k , M , n , N ) : # Manual integration over probability mass function. More accurate # than integrate.quad. k2 = np . arange ( quant + 1 , draw + 1 ) res . append ( np . sum ( self . _pmf ( k2 , tot , good , draw ) ) ) return np . asarray ( res )