Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

dataframe drop all rows with value

# create a new dataframe CONTAINING ONLY the rows, where the value
# of some_column = some_value
new_df = old_df.loc[old_df['some_column']=='some_value']
# create a new dataframe EXCLUDING the rows, where the value of
# some_column = some_value
new_df = old_df.loc[old_df['some_column']!='some_value']
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #dataframe #drop #rows
ADD COMMENT
Topic
Name
2+5 =