1
$\begingroup$

How to implement multiple filters for checking data cell in a range ?

Suppose, I have a list of numbers like,


range_1 = [ 70 ,15,5,7,3,7,8,3,2, 63  ]

# and

range_1 = [ 50, 56, 80, 61, 83, 87, 13, 58, 43, 24, 84, 54, 64,36, 48  ]

And I want to check any column values exist within these two lists.


Any suggestion would be appreciated


$\endgroup$
0
2
$\begingroup$
data.loc[ data['age'].isin(range_1) & data['height'].isin(range_2) ]
$\endgroup$
1
  • $\begingroup$ Yes, Excellent @10xAI, It's work, I just forgot about isin() method. $\endgroup$ Sep 12 '20 at 11:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.