staircase.corr¶
- staircase.corr(collection, where=(<staircase.constants.NegInf object>, <staircase.constants.Inf object>))¶
Calculates the correlation matrix for a collection of
Stairs
instances- Parameters
- collection: :class:`pandas.Series`, dict, or array-like of :class:`Stairs` values
the stairs instances with which to compute the correlation matrix
- lowerint, float or pandas.Timestamp
lower bound of the interval on which to perform the calculation
- upperint, float or pandas.Timestamp
upper bound of the interval on which to perform the calculation
- Returns
pandas.DataFrame
The correlation matrix
See also
Examples
>>> import staircase as sc >>> pd.Series([s1, s2, s1+s2]) 0 <staircase.Stairs, id=2452772382088, dates=False> 1 <staircase.Stairs, id=2452772381320, dates=False> 2 <staircase.Stairs, id=2452772893512, dates=False> dtype: object
>>> sc.corr(pd.Series([s1, s2, s1+s2], index=['s1', 's2', 's1+s2'])) s1 s2 s1+s2 s1 1.000000 0.246878 0.700249 s2 0.246878 1.000000 0.792407 s1+ s2 0.700249 0.792407 1.000000
>>> sc.corr([s1, s2, s1+s2]) 0 1 2 0 1.000000 0.246878 0.700249 1 0.246878 1.000000 0.792407 2 0.700249 0.792407 1.000000