Skip to content

Commit

Permalink
BUG: fillna maximum recursion depth exceeded in cmp (GH18159).
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof Chomski committed Nov 9, 2017
1 parent 8dac633 commit 9884e41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.22.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Bug Fixes
- Bug in ``pd.read_msgpack()`` with a non existent file is passed in Python 2 (:issue:`15296`)
- Bug in ``DataFrame.groupby`` where key as tuple in a ``MultiIndex`` were interpreted as a list of keys (:issue:`17979`)
- Bug in :func:`pd.read_csv` where a ``MultiIndex`` with duplicate columns was not being mangled appropriately (:issue:`18062`)
- BUG: fillna maximum recursion depth exceeded in cmp (:issue:`18159`)

Conversion
^^^^^^^^^^
Expand Down
5 changes: 3 additions & 2 deletions pandas/core/internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -1837,8 +1837,9 @@ def _can_hold_element(self, element):
if tipo is not None:
return (issubclass(tipo.type, (np.floating, np.integer)) and
not issubclass(tipo.type, (np.datetime64, np.timedelta64)))
return (isinstance(element, (float, int, np.floating, np.int_)) and
not isinstance(element, (bool, np.bool_, datetime, timedelta,
return (
isinstance(element, (float, int, np.floating, np.int_, np.long))
and not isinstance(element, (bool, np.bool_, datetime, timedelta,
np.datetime64, np.timedelta64)))

def to_native_types(self, slicer=None, na_rep='', float_format=None,
Expand Down

0 comments on commit 9884e41

Please sign in to comment.