@doc(template_header, create_section_header('Parameters'), dedent('\n        other : Series or DataFrame, optional\n            If not supplied then will default to self and produce pairwise\n            output.\n        pairwise : bool, default None\n            If False then only matching columns between self and other will be\n            used and the output will be a DataFrame.\n            If True then all pairwise combinations will be calculated and the\n            output will be a MultiIndex DataFrame in the case of DataFrame\n            inputs. In the case of missing elements, only complete pairwise\n            observations will be used.\n        ').replace('\n', '', 1), kwargs_compat, create_section_header('Returns'), template_returns, create_section_header('See Also'), template_see_also[:(- 1)], window_method='ewm', aggregation_description='(exponential weighted moment) sample correlation', agg_method='corr')
def corr(self, other: ((DataFrame | Series) | None)=None, pairwise: (bool | None)=None, **kwargs):
    from pandas import Series

    def cov_func(x, y):
        x_array = self._prep_values(x)
        y_array = self._prep_values(y)
        window_indexer = self._get_window_indexer()
        min_periods = (self.min_periods if (self.min_periods is not None) else window_indexer.window_size)
        (start, end) = window_indexer.get_window_bounds(num_values=len(x_array), min_periods=min_periods, center=self.center, closed=self.closed)

        def _cov(X, Y):
            return window_aggregations.ewmcov(X, start, end, min_periods, Y, self._com, self.adjust, self.ignore_na, True)
        with np.errstate(all='ignore'):
            cov = _cov(x_array, y_array)
            x_var = _cov(x_array, x_array)
            y_var = _cov(y_array, y_array)
            result = (cov / zsqrt((x_var * y_var)))
        return Series(result, index=x.index, name=x.name)
    return self._apply_pairwise(self._selected_obj, other, pairwise, cov_func)
@doc(template_header, create_section_header('Parameters'), dedent('\n        other : Series or DataFrame, optional\n            If not supplied then will default to self and produce pairwise\n            output.\n        pairwise : bool, default None\n            If False then only matching columns between self and other will be\n            used and the output will be a DataFrame.\n            If True then all pairwise combinations will be calculated and the\n            output will be a MultiIndex DataFrame in the case of DataFrame\n            inputs. In the case of missing elements, only complete pairwise\n            observations will be used.\n        ').replace('\n', , 1), kwargs_compat, create_section_header('Returns'), template_returns, create_section_header('See Also'), template_see_also[:(- 1)], window_method='ewm', aggregation_description='(exponential weighted moment) sample correlation', agg_method='corr')
def corr(self, other: ((DataFrame | Series) | None)=None, pairwise: (bool | None)=None, **kwargs):
    from pandas import Series

    def cov_func(x, y):
        x_array = self._prep_values(x)
        y_array = self._prep_values(y)
        window_indexer = self._get_window_indexer()
        min_periods = (self.min_periods if (self.min_periods is not None) else window_indexer.window_size)
        (start, end) = window_indexer.get_window_bounds(num_values=len(x_array), min_periods=min_periods, center=self.center, closed=self.closed)

        def _cov(X, Y):
            return window_aggregations.ewmcov(X, start, end, min_periods, Y, self._com, self.adjust, self.ignore_na, True)
        with np.errstate(all='ignore'):
            cov = _cov(x_array, y_array)
            x_var = _cov(x_array, x_array)
            y_var = _cov(y_array, y_array)
            result = (cov / zsqrt((x_var * y_var)))
        return Series(result, index=x.index, name=x.name)
    return self._apply_pairwise(self._selected_obj, other, pairwise, cov_func)