# filter col1 by numbers greater than 8 but smaller than 10 df[np.logical_and(df['col1'] > 8, df['col1'] < 10)] # other way dogs[(df['breeds'] == 'Labrador') & (df['color'] == 'brown')] # other way dogs[dogs['color'].isin(['brown', 'black'])] # other way (if applied on index) dogs.loc[['brown', 'black']]
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter