python - delete string in a pandas dataframe -


i have

df =  pandasdataframe data. 

i have second pandas-dataframe (called df_outlier) keys (that exist in df) , want remove them df.

df_outlier 

i looking following function - might not right approach. key contains alphanumeric values - letters , numbers. not int.

clean_df = (df['id'] - df_outlier['id']) 

any ideas? thanks.

to filter df using multiple values df can use isin, return boolean mask rows values exist in passed in list/series. in order filter out these values use negation operator ~ invert mask:

clean_df = df[~df['id'].isin(df_outlier['id'])] 

Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

node.js - How to abort query on demand using Neo4j drivers -