Skip to content

Commit

Permalink
Fixes for jreback's review
Browse files Browse the repository at this point in the history
  • Loading branch information
MomIsBestFriend committed Dec 28, 2019
1 parent 0c841b9 commit 0403012
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pandas/core/nanops.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ def _has_infs(result) -> bool:


def _get_fill_value(
dtype: Dtype, fill_value: Any = None, fill_value_typ: Optional[str] = None
dtype: Dtype,
fill_value: Optional[Scalar] = None,
fill_value_typ: Optional[str] = None,
):
""" return the correct fill value for the dtype of the values """
if fill_value is not None:
Expand Down Expand Up @@ -1279,10 +1281,7 @@ def _zero_out_fperr(arg):

@disallow("M8", "m8")
def nancorr(
a: np.ndarray,
b: np.ndarray,
method: str = "pearson",
min_periods: Optional[int] = None,
a: np.ndarray, b: np.ndarray, method="pearson", min_periods: Optional[int] = None,
):
"""
a, b: ndarrays
Expand All @@ -1305,8 +1304,8 @@ def nancorr(
return f(a, b)


def get_corr_func(method: str):
if method in ["kendall", "spearman"]:
def get_corr_func(method) -> Callable:
if method in ["kendall", "spearman", "pearson"]:
from scipy.stats import kendalltau, spearmanr
elif callable(method):
return method
Expand Down

0 comments on commit 0403012

Please sign in to comment.