コード例 #1
0
def intercept(xarray, yarray):
  """
  Computes the regression intercept for the x,y pairs
  :param np.array.dtype=float xarray:
  :param np.array.dtype=float yarray:
  """
  pruned_x = pruneNulls(xarray)
  pruned_y = pruneNulls(yarray)
  _, intercept, _, _, _ = ss.linregress(pruned_x, pruned_y)
  result = np.array(np.repeat(np.nan, len(xarray)), dtype=np.float)
  result[0] = intercept
  return result
コード例 #2
0
ファイル: slope.py プロジェクト: zdog234/SciSheets
def slope(xarray, yarray):
    """
  Computes the regression slope for the x,y pairs
  :param np.array.dtype=float xarray:
  :param np.array.dtype=float yarray:
  """
    pruned_x = pruneNulls(xarray)
    pruned_y = pruneNulls(yarray)
    slope, _, _, _, _ = ss.linregress(pruned_x, pruned_y)
    result = np.array(np.repeat(np.nan, len(xarray)), dtype=np.float)
    result[0] = slope
    return result
コード例 #3
0
ファイル: slope.py プロジェクト: ScienceStacks/SciSheets
def slope(xarray, yarray):
    """
  Computes the regression slope for the x,y pairs
  :param np.array.dtype=float xarray:
  :param np.array.dtype=float yarray:
  """
    pruned_x = pruneNulls(xarray)
    pruned_y = pruneNulls(yarray)
    slope, _, _, _, _ = ss.linregress(pruned_x, pruned_y)
    result = np.array(np.repeat(np.nan, len(xarray)), dtype=np.float)
    result[0] = slope
    return result