Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to delete row pandas in for loop

#This is how to delete rows in for loop

for index, row in df.iterrows():
    if row['a'] > 0:
        df.drop(index, inplace=True)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #delete #row #pandas #loop
ADD COMMENT
Topic
Name
4+1 =