expanding_mean
expanding_mean(x, skipna=False)
| Name | Type | Description | Default |
|---|---|---|---|
x | np.ndarray | Input array. | required |
skipna | bool | If True, exclude NaN values from calculations. When False (default), any NaN value causes the result to be NaN, maintaining backwards compatibility. When True, NaN values are ignored (matching pandas default behavior). | required |
| Type | Description |
|---|---|
| np.ndarray: Array with the expanding statistic |
>>> import numpy as np
>>> x = np.array([1.0, 2.0, np.nan, 4.0, 5.0])
>>> # Default behavior: NaN propagates
>>> expanding_mean(x)
array([1., 1.5, nan, nan, nan])
>>> # With skipna=True: NaN values are excluded
>>> expanding_mean(x, skipna=True)
array([1., 1.5, 1.5, 2.33..., 3.0])
expanding_std
expanding_std(x, skipna=False)
| Name | Type | Description | Default |
|---|---|---|---|
x | np.ndarray | Input array. | required |
skipna | bool | If True, exclude NaN values from calculations. When False (default), any NaN value causes the result to be NaN, maintaining backwards compatibility. When True, NaN values are ignored (matching pandas default behavior). | required |
| Type | Description |
|---|---|
| np.ndarray: Array with the expanding statistic |
>>> import numpy as np
>>> x = np.array([1.0, 2.0, np.nan, 4.0, 5.0])
>>> # Default behavior: NaN propagates
>>> expanding_std(x)
array([1., 1.5, nan, nan, nan])
>>> # With skipna=True: NaN values are excluded
>>> expanding_std(x, skipna=True)
array([1., 1.5, 1.5, 2.33..., 3.0])
expanding_min
expanding_min(x, skipna=False)
| Name | Type | Description | Default |
|---|---|---|---|
x | np.ndarray | Input array. | required |
skipna | bool | If True, exclude NaN values from calculations. When False (default), any NaN value causes the result to be NaN, maintaining backwards compatibility. When True, NaN values are ignored (matching pandas default behavior). | required |
| Type | Description |
|---|---|
| np.ndarray: Array with the expanding statistic |
>>> import numpy as np
>>> x = np.array([1.0, 2.0, np.nan, 4.0, 5.0])
>>> # Default behavior: NaN propagates
>>> expanding_min(x)
array([1., 1.5, nan, nan, nan])
>>> # With skipna=True: NaN values are excluded
>>> expanding_min(x, skipna=True)
array([1., 1.5, 1.5, 2.33..., 3.0])
expanding_max
expanding_max(x, skipna=False)
| Name | Type | Description | Default |
|---|---|---|---|
x | np.ndarray | Input array. | required |
skipna | bool | If True, exclude NaN values from calculations. When False (default), any NaN value causes the result to be NaN, maintaining backwards compatibility. When True, NaN values are ignored (matching pandas default behavior). | required |
| Type | Description |
|---|---|
| np.ndarray: Array with the expanding statistic |
>>> import numpy as np
>>> x = np.array([1.0, 2.0, np.nan, 4.0, 5.0])
>>> # Default behavior: NaN propagates
>>> expanding_max(x)
array([1., 1.5, nan, nan, nan])
>>> # With skipna=True: NaN values are excluded
>>> expanding_max(x, skipna=True)
array([1., 1.5, 1.5, 2.33..., 3.0])
expanding_quantile
expanding_quantile(x, p, skipna=False)
| Name | Type | Description | Default |
|---|---|---|---|
x | ndarray | Input array. | required |
p | float | Quantile to compute. | required |
skipna | bool | If True, exclude NaN values from calculations. When False (default), any NaN value causes the result to be NaN, maintaining backwards compatibility. When True, NaN values are ignored (matching pandas default behavior). | False |
| Type | Description |
|---|---|
ndarray | np.ndarray: Array with the expanding statistic |
>>> import numpy as np
>>> x = np.array([1.0, 2.0, np.nan, 4.0, 5.0])
>>> # Default behavior: NaN propagates
>>> expanding_quantile(x, 0.5)
array([1., 1.5, nan, nan, nan])
>>> # With skipna=True: NaN values are excluded
>>> expanding_quantile(x, 0.5, skipna=True)
array([1., 1.5, 1.5, 2., 2.5])

