How to apply multiple filter in Data Frame? [closed]
-
13-12-2020 - |
Domanda
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
Soluzione
data.loc[ data['age'].isin(range_1) & data['height'].isin(range_2) ]
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a datascience.stackexchange