Skip to content

Commit 254193b

Browse files
author
Krzysztof Chomski
committed
BUG: fillna maximum recursion depth exceeded in cmp (GH18159).
1 parent 8dac633 commit 254193b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

doc/source/whatsnew/v0.22.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ Bug Fixes
9090
- Bug in ``pd.read_msgpack()`` with a non existent file is passed in Python 2 (:issue:`15296`)
9191
- Bug in ``DataFrame.groupby`` where key as tuple in a ``MultiIndex`` were interpreted as a list of keys (:issue:`17979`)
9292
- Bug in :func:`pd.read_csv` where a ``MultiIndex`` with duplicate columns was not being mangled appropriately (:issue:`18062`)
93+
- BUG: fillna maximum recursion depth exceeded in cmp (:issue:`18159`)
9394

9495
Conversion
9596
^^^^^^^^^^

pandas/core/internals.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1837,8 +1837,9 @@ def _can_hold_element(self, element):
18371837
if tipo is not None:
18381838
return (issubclass(tipo.type, (np.floating, np.integer)) and
18391839
not issubclass(tipo.type, (np.datetime64, np.timedelta64)))
1840-
return (isinstance(element, (float, int, np.floating, np.int_)) and
1841-
not isinstance(element, (bool, np.bool_, datetime, timedelta,
1840+
return (
1841+
isinstance(element, (float, int, np.floating, np.int_, np.long))
1842+
and not isinstance(element, (bool, np.bool_, datetime, timedelta,
18421843
np.datetime64, np.timedelta64)))
18431844

18441845
def to_native_types(self, slicer=None, na_rep='', float_format=None,

0 commit comments

Comments
 (0)