Skip to content

Commit 41436c2

Browse files
committed
Update code after @jreback's comments
1 parent 4996e76 commit 41436c2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

doc/source/whatsnew/v0.21.0.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,9 +588,10 @@ Indexing
588588
- Bug in ``CategoricalIndex`` reindexing in which specified indices containing duplicates were not being respected (:issue:`17323`)
589589
- Bug in intersection of ``RangeIndex`` with negative step (:issue:`17296`)
590590
- Bug in ``IntervalIndex`` where performing a scalar lookup fails for included right endpoints of non-overlapping monotonic decreasing indexes (:issue:`16417`, :issue:`17271`)
591+
<<<<<<< 4996e764fb0adbd5c77574eb3cb60f19c0fafba3
591592
<<<<<<< 99300ddcc636c859a02b3010ee379d1adbd1678e
592593
- Bug in :meth:`DataFrame.first_valid_index` and :meth:`DataFrame.last_valid_index` when no valid entry (:issue:`17400`)
593-
- Bug in ``Series.rename`` when called with `str` alters name of series rather than index of series. (:issue:`17407`)
594+
- Bug in ``Series.rename`` when called with a `callable` alters name of series rather than index of series. (:issue:`17407`)
594595

595596
I/O
596597
^^^

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)