From 08c0b26152e0c077794ad1139e14ef63f7aa5f73 Mon Sep 17 00:00:00 2001 From: Huashuai Qu Date: Mon, 25 Sep 2017 13:16:56 -0700 Subject: [PATCH] Change `or` to `and` for checking iterable --- pandas/core/dtypes/inference.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/core/dtypes/inference.py b/pandas/core/dtypes/inference.py index 1e0c4fe180207c..9051c6749f0435 100644 --- a/pandas/core/dtypes/inference.py +++ b/pandas/core/dtypes/inference.py @@ -263,9 +263,10 @@ def is_list_like(obj): False """ - return ((hasattr(obj, '__iter__') or isinstance(obj, Iterable)) and + return (hasattr(obj, '__iter__') and isinstance(obj, Iterable) and not isinstance(obj, string_and_binary_types)) + def is_nested_list_like(obj): """ Check if the object is list-like, and that all of its elements