File tree Expand file tree Collapse file tree 1 file changed +0
-20
lines changed Expand file tree Collapse file tree 1 file changed +0
-20
lines changed Original file line number Diff line number Diff line change @@ -18,48 +18,28 @@ df = pd.read_csv("new_york_city.csv")
18
18
## Print Rows from a Dateframe using an Integer Index 🗃
19
19
Print 10 Rows from a Dateframe using an Integer Index from 10-20. (Method .iloc[ from: to ] )
20
20
```
21
- import pandas as pd
22
-
23
- df = pd.read_csv("new_york_city.csv")
24
-
25
21
# Print 10 Rows from Dateframe with Integer Index from 10-20
26
-
27
22
print(df.iloc[10:20])
28
23
```
29
24
30
25
## Print the first Rows from a Dateframe 🗃
31
26
Print the first 10 Rows from a Dateframe. (Method .head(amount))
32
27
```
33
- import pandas as pd
34
-
35
- df = pd.read_csv("new_york_city.csv")
36
-
37
28
# Print the first 10 Rows from the Dateframe
38
-
39
29
print(df.head(10))
40
30
```
41
31
42
32
43
33
## Print Rows from a Dateframe and sort them with an attribute 🗃
44
34
Print 10 Rows from a Dateframe using an Integer Index from 0-10 and sort them with an attribute. (Method .sort_values([ "Start Time"] ))
45
35
```
46
- import pandas as pd
47
-
48
- df = pd.read_csv("new_york_city.csv")
49
-
50
36
# Prints the first 10 Rows, sorted by Start Time
51
-
52
37
print(df.iloc[0:10].sort_values(["Start Time"]))
53
38
```
54
39
55
40
## Print 10 random Rows from a Dateframe 🗃
56
41
Print 10 random Rows from a Dateframe. (Method .sample(amount))
57
42
```
58
- import pandas as pd
59
-
60
- df = pd.read_csv("new_york_city.csv")
61
-
62
43
# Print 10 random Rows from a Dateframe
63
-
64
44
print(df.sample(10))
65
45
```
You can’t perform that action at this time.
0 commit comments