Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python check if variable is iterable

from collections import Iterable

def iterable(obj):
    return isinstance(obj, Iterable)
Comment

check if variable is iterable python

from collections.abc import Iterable

data = []

if isinstance(data, Iterable):
     pass # data is iterable
Comment

PREVIOUS NEXT
Code Example
Python :: python rename file 
Python :: hyperlinks in jupyter notebook 
Python :: openai gym conda 
Python :: classification report scikit 
Python :: python get filename from path 
Python :: save fig plot dataframe 
Python :: selenium change window size 
Python :: filter dataframe columns vy a list of columns 
Python :: numpy install 
Python :: how to check datatype of column in dataframe python 
Python :: tkiner border 
Python :: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject 
Python :: pandas convert index to column 
Python :: count unique values numpy 
Python :: pandas save without index 
Python :: how to create a keylogger in python 
Python :: inspectdb django 
Python :: get website content with beautifulsoup 
Python :: python format 2 digits 
Python :: write a python program to read last n lines of a file 
Python :: python filter None dictionary 
Python :: colab cuda version 
Python :: python confidence interval 
Python :: python infinite value 
Python :: dice simulator in python 
Python :: roc curve python 
Python :: how to clear console in python 
Python :: How to convert an integer number into words in python? 
Python :: pyautogui keyboard write 
Python :: django filter not equal to 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =