kieferk / dfply

dplyr-style piping operations for pandas dataframes
GNU General Public License v3.0
889 stars 103 forks source link

Filtering two or more elements from a column #98

Open thap2331 opened 4 years ago

thap2331 commented 4 years ago

Hi, I am new to piping but I really want to start working using pipes.

I have a dataframe in which one of the column is country names. I want to mask only few countries. I know we can do this if I want only one element. (df_world >> mask(X.Country=='Nigeria')).

But how do I select multiple countries from a column. For example, I want 'Nigeria' and 'China' only?