Question
Assuming the given dataset answer the questions given below:

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.

Answer

Get the step-by-step solution for this question inside the Vidyadip app.

Get the answer in the app

Need a full question paper?

Generate a complete, print-ready paper with questions like this in minutes — across 16+ boards, with answer keys.

Start Generating Free

Similar questions

Write a script to create a list of 10 random integers and display it. Then input an integer from the user and check whether it is present in the list (use in operator) and display an appropriate message.

Write python program using function to find the sum of first n terms of the following series:

where n and x have to be input from the user. The function should have two parameter n and x and return the sum of the series.

Write the different types of plagiarism.
Write the Pseudocode to sort the list using Selection sort – to sort a list A in ascending order
Write a program which will store the student information in the form of a nested list as follows.

( i.e: student_name, roll_number, avg_marks )

What are the adverse effects of technology?
Intelligent Hub India is a knowledge community aimed to uplift the standard of skills and knowledge in the society. It is planning to setup its training centers in multiple towns and villages pan India with its head offices in the nearest cities. They have created a model of their network with a city, a town and 3 villages as follows.

As a network consultant, you have to suggest the best network related solutions for their issues/problems raised in (a) to (d), keeping in mind the distances between various locations and other given parameters.

Shortest distance between various locations:

VILLAGE 1 to YTOWN 2 KM
VILLAGE 2 to YTOWN 1.5 KM
VILLAGE 3 to YTOWN 3 KM
VILLAGE 1 to VILLAGE 2 3.5 KM
VILLAGE 1 to VILLAGE 3 4.5 KM
VILLAGE 2 to VILLAGE 3 3.5 KM
CITY Head Office to YHUB 30 KM

Number of computers installed at various locations are as follows:

YTOWN 100
VILLAGE 1 10
VILLAGE 2 15
VILLAGE 3 15
CITY OFFICE 5

Note:
• In Villages, there are community centers, in which one room has been given as training center to this organization to install computers.

• The organization has got financial support from the government and top IT companies.

(a) Suggest the most appropriate location of the SERVER in the YHUB (out of the 4 locations), to get the best and effective connectivity. Justify your answer.

(b) Suggest the best wired medium and draw the cable layout (location to location) to efficiently connect various locations within the YHUB.

(c) Which hardware device will you suggest to connect all the computers within each location of YHUB?

(d) Which service/protocol will be most helpful to conduct live interactions of Experts from Head Office and people at YHUB locations?

WAP to find the sum of first n terms of the following series:
$x-x^2+x^3+\ldots$

Write the output for the following commands:

Table- Loan_accounts

account cust_name loan_amount installment int_rate start_rate interest
1 R.K. Gupta 300000 36 12.00 2009-07-19 Null
2 S.P. Sharma 500000 48 10.00 2008-03-22 Null
3 K.P. Jain 300000 36 Null 2007-08-03 Null
4 M.P. Yadav 800000 60 10.00 2008-12-06 Null
5 S.P. Sinha 200000 36 12.50 2010-01-03 Null
6 P. Sharma 700000 60 12.50 2008-06-05 Null
7 K.S. Dhall 500000 48 Null 2008-03-05 Null

(a)

(b)

(c)

(d)

(e)

Write a python program using function to accept a list as parameter and return the sum of all the list elements.