Skip to content

Commit 2c46b75

Browse files
committed
avoid nanops test failures
1 parent f301506 commit 2c46b75

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/core/nanops.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ def f(
151151

152152

153153
def _bn_ok_dtype(dtype: DtypeObj, name: str) -> bool:
154-
# Bottleneck chokes on datetime64, numpy strins, PeriodDtype (or and EA)
154+
if issubclass(dtype, np.generic):
155+
dtype = np.dtype(dtype)
156+
# Bottleneck chokes on datetime64, numpy strings, PeriodDtype (or and EA)
155157
if dtype != object and dtype.kind != "T" and not needs_i8_conversion(dtype):
156158
# GH 42878
157159
# Bottleneck uses naive summation leading to O(n) loss of precision

0 commit comments

Comments
 (0)