1
1
#` 05.6 ` Loc Function
2
2
3
- You can also use the` data_frame. loc` function to filter records using logical operations as indexes, like this:
3
+ You can also use the` loc ` function to filter records using logical operations as indexes, like this:
4
4
5
5
``` python
6
- # get peoplemore than 18 years old
6
+ # Get peopleolder than 18 years old
7
7
data_frame.loc[data_frame[' age' ]> 18 ]
8
8
```
9
9
10
10
##📝 Instructions:
11
11
12
12
1 . Use the same DataFrame variable you used in the previous exercise.
13
+
13
14
2 . Using the` loc ` function, print on the terminal all pokemons with an attack of more than 80.
14
15
15
- ##Expected Result:
16
+ ##💻 Expected Result:
16
17
17
18
``` bash
18
19
# Name Type 1 Type 2 HP Attack Defense Sp. Atk Sp. Def Speed Generation Legendary
@@ -27,4 +28,4 @@ data_frame.loc[data_frame['age'] > 18]
27
28
797 720 HoopaHoopa Confined Psychic Ghost 80 110 60 150 130 70 6 True
28
29
798 720 HoopaHoopa Unbound Psychic Dark 80 160 60 170 130 80 6 True
29
30
799 721 Volcanion Fire Water 80 110 120 130 90 70 6 True
30
- ```
31
+ ```