<a id="skfolio-measures-skew"></a>

# skfolio.measures.skew

<a id="skfolio.measures.skew"></a>

### skfolio.measures.skew(returns, sample_weight=None)

Compute the Skew.

The Skew is a measure of the lopsidedness of the distribution.
A symmetric distribution have a Skew of zero.
Higher Skew corresponds to longer right tail.

* **Parameters:**
  **returns** *ndarray of shape (n_observations,) or (n_observations, n_assets)*
  : Array of return values.

  **sample_weight** *ndarray of shape (n_observations,), optional*
  : Relative observation weights. Must be finite and nonnegative. If None,
    equal weights are assumed.
* **Returns:**
  **value** *float or ndarray of shape (n_assets,)*
  : Skew.
    If `returns` is a 1D-array, the result is a float.
    If `returns` is a 2D-array, the result is a ndarray of shape (n_assets,).

### Notes

NaN handling:
NaN returns are excluded from each column’s calculation. Remaining sample
weights are rescaled to sum to one. The result is NaN if no observations
or no positive weight remain.

Nearly constant returns produce NaN when the second central moment is at
most `(eps * mean)**2`. Here `eps` is machine precision and `mean` uses the
same sample weights.

