def corrwith(self, other, axis=<NUM_LIT:0>, drop=False, method='<STR_LIT>'):
axis = self._get_axis_number(axis)<EOL>this = self._get_numeric_data()<EOL>if isinstance(other, Series):<EOL><INDENT>return this.apply(lambda x: other.corr(x, method=method),<EOL>axis=axis)<EOL><DEDENT>other = other._get_numeric_data()<EOL>left, right = this.align(other, join='<STR_LIT>', copy=False)<EOL>if axis == <NUM_LIT:1>:<EOL><INDENT>left = left.T<EOL>right = right.T<EOL><DEDENT>if method == '<STR_LIT>':<EOL><INDENT>left = left + right * <NUM_LIT:0><EOL>right = right + left * <NUM_LIT:0><EOL>ldem = left - left.mean()<EOL>rdem = right - right.mean()<EOL>num = (ldem * rdem).sum()<EOL>dom = (left.count() - <NUM_LIT:1>) * left.std() * right.std()<EOL>correl = num / dom<EOL><DEDENT>elif method in ['<STR_LIT>', '<STR_LIT>'] or callable(method):<EOL><INDENT>def c(x):<EOL><INDENT>return nanops.nancorr(x[<NUM_LIT:0>], x[<NUM_LIT:1>], method=method)<EOL><DEDENT>correl = Series(map(c,<EOL>zip(left.values.T, right.values.T)),<EOL>index=left.columns)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".<EOL>format(method=method))<EOL><DEDENT>if not drop:<EOL><INDENT>raxis = <NUM_LIT:1> if axis == <NUM_LIT:0> else <NUM_LIT:0><EOL>result_index = (this._get_axis(raxis).<EOL>union(other._get_axis(raxis)))<EOL>idx_diff = result_index.difference(correl.index)<EOL>if len(idx_diff) > <NUM_LIT:0>:<EOL><INDENT>correl = correl.append(Series([np.nan] * len(idx_diff),<EOL>index=idx_diff))<EOL><DEDENT><DEDENT>return correl<EOL>
Compute pairwise correlation between rows or columns of DataFrame
with rows or columns of Series or DataFrame.  DataFrames are first
aligned along both axes before computing the correlations.

Parameters
----------
other : DataFrame, Series
    Object with which to compute correlations.
axis : {0 or 'index', 1 or 'columns'}, default 0
    0 or 'index' to compute column-wise, 1 or 'columns' for row-wise.
drop : bool, default False
    Drop missing indices from result.
method : {'pearson', 'kendall', 'spearman'} or callable
    * pearson : standard correlation coefficient
    * kendall : Kendall Tau correlation coefficient
    * spearman : Spearman rank correlation
    * callable: callable with input two 1d ndarrays
        and returning a float

    .. versionadded:: 0.24.0

Returns
-------
Series
    Pairwise correlations.

See Also
-------
DataFrame.corr