sem#

sem(a, axis=None, *args, **kwargs)[source]#

Calculate the standard error of the mean (SEM).

Shortcut (for a 1D array) to array.std()/np.sqrt(len(array)).

Parameters:
  • a (arr) – array to calculate the SEM of

  • axis (int) – axis to calculate the SEM along

  • kwargs (dict) – passed to numpy.std()

Example:

data = np.random.randn(100)
sem = sc.sem(data) # Roughly 0.1
New in version 3.2.0.