Skip to content

Commit 7a179d6

Browse files
committed
Update code after @jreback's comments
1 parent ccb3887 commit 7a179d6

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

doc/source/whatsnew/v0.21.0.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ Indexing
517517
- Bug in ``CategoricalIndex`` reindexing in which specified indices containing duplicates were not being respected (:issue:`17323`)
518518
- Bug in intersection of ``RangeIndex`` with negative step (:issue:`17296`)
519519
- Bug in ``IntervalIndex`` where performing a scalar lookup fails for included right endpoints of non-overlapping monotonic decreasing indexes (:issue:`16417`, :issue:`17271`)
520-
- Bug in ``Series.rename`` when called with `str` alters name of series rather than index of series. (:issue:`17407`)
520+
- Bug in ``Series.rename`` when called with a `callable` alters name of series rather than index of series. (:issue:`17407`)
521521

522522
I/O
523523
^^^

pandas/core/dtypes/inference.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import collections
44
import re
55
import numpy as np
6+
from collections import Iterable
67
from numbers import Number
78
from pandas.compat import (PY2, string_types, text_type,
89
string_and_binary_types)
@@ -262,10 +263,8 @@ def is_list_like(obj):
262263
False
263264
"""
264265

265-
return (hasattr(obj, '__iter__') and
266-
not isinstance(obj, string_and_binary_types) and
267-
isinstance(obj, collections.Iterable))
268-
266+
return ((hasattr(obj, '__iter__') or isinstance(obj, Iterable)) and
267+
not isinstance(obj, string_and_binary_types))
269268

270269
def is_nested_list_like(obj):
271270
"""

0 commit comments

Comments
 (0)