Get the step-by-step solution for this question inside the Vidyadip app.
Get the answer in the appGenerate a complete, print-ready paper with questions like this in minutes — across 16+ boards, with answer keys.
| animal | age | visits | priority | |
| a | cat | 2.5 | 1 | yes |
| b | cat | 3.0 | 3 | yes |
| c | snake | 0.5 | 2 | No |
| d | dog | NaN | 3 | yes |
| e | dog | 5.0 | 2 | No |
| f | cat | 2.0 | 3 | No |
| g | snake | 4.5 | 1 | No |
| h | cat | NaN | 1 | yes |
| i | dog | 7.0 | 2 | No |
| j | dog | 3.0 | 1 | No |
(a) To create the dataframe from the above dictionary and index is stored in label list.
(b) To display the Data frame.
(c) To calculate the sum of all visits (the total number of visits).
(d) Calculate the mean age for each different animal in df
(e) To Append a new row 'k' to df with your choice of values for each column.
(f) To delete the new entered row.
(g) To count the number of each type of animal in df.
(h) To sort df first by the values in the 'age' in descending order, then by the value in the 'visit' column in ascending order.
(i) To print the maximum values of each column.
(j) To display all the statistics.
(k) To sort the data according the index.