Skip to content

Commit f12b581

Browse files
author
MomIsBestFriend
committed
Fixes for jreback's review
1 parent 018e84d commit f12b581

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

pandas/core/nanops.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ def _has_infs(result) -> bool:
167167

168168

169169
def _get_fill_value(
170-
dtype: Dtype, fill_value: Any = None, fill_value_typ: Optional[str] = None
170+
dtype: Dtype,
171+
fill_value: Optional[Scalar] = None,
172+
fill_value_typ: Optional[str] = None,
171173
):
172174
""" return the correct fill value for the dtype of the values """
173175
if fill_value is not None:
@@ -1279,10 +1281,7 @@ def _zero_out_fperr(arg):
12791281

12801282
@disallow("M8", "m8")
12811283
def nancorr(
1282-
a: np.ndarray,
1283-
b: np.ndarray,
1284-
method: str = "pearson",
1285-
min_periods: Optional[int] = None,
1284+
a: np.ndarray, b: np.ndarray, method="pearson", min_periods: Optional[int] = None,
12861285
):
12871286
"""
12881287
a, b: ndarrays
@@ -1305,8 +1304,8 @@ def nancorr(
13051304
return f(a, b)
13061305

13071306

1308-
def get_corr_func(method: str):
1309-
if method in ["kendall", "spearman"]:
1307+
def get_corr_func(method) -> Callable:
1308+
if method in ["kendall", "spearman", "pearson"]:
13101309
from scipy.stats import kendalltau, spearmanr
13111310
elif callable(method):
13121311
return method

0 commit comments

Comments
 (0)