Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas drop rows with empty list

# Drop all rows that have an empty list in "example_column"

df[df['example_column'].map(lambda d: len(d)) > 0]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #drop #rows #empty #list
ADD COMMENT
Topic
Name
8+3 =