dfply icon indicating copy to clipboard operation
dfply copied to clipboard

Filtering two or more elements from a column

Open thap2331 opened this issue 4 years ago • 0 comments

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?

thap2331 avatar Apr 01 '20 04:04 thap2331