Setting and Resetting the Index
Creating a pandas DataFrame and setting and resetting the index.
Importing libraries and packages
Creating dataset
|
Age |
Height |
Weight |
A |
22 |
66 |
140 |
B |
42 |
70 |
148 |
C |
30 |
62 |
125 |
D |
35 |
68 |
160 |
E |
25 |
62 |
152 |
Wrangling
|
index |
Age |
Height |
Weight |
0 |
A |
22 |
66 |
140 |
1 |
B |
42 |
70 |
148 |
2 |
C |
30 |
62 |
125 |
3 |
D |
35 |
68 |
160 |
4 |
E |
25 |
62 |
152 |
|
Age |
Height |
Weight |
0 |
22 |
66 |
140 |
1 |
42 |
70 |
148 |
2 |
30 |
62 |
125 |
3 |
35 |
68 |
160 |
4 |
25 |
62 |
152 |
|
Age |
Height |
Weight |
Profession |
A |
22 |
66 |
140 |
Student |
B |
42 |
70 |
148 |
Teacher |
C |
30 |
62 |
125 |
Engineer |
D |
35 |
68 |
160 |
Doctor |
E |
25 |
62 |
152 |
Nurse |
|
Age |
Height |
Weight |
Profession |
|
|
|
Student |
22 |
66 |
140 |
Teacher |
42 |
70 |
148 |
Engineer |
30 |
62 |
125 |
Doctor |
35 |
68 |
160 |
Nurse |
25 |
62 |
152 |