You are on page 1of 4

DELHI PUBLIC SCHOOL HARNI

Practice Paper

Q1 Section –A 14
Each question carries 1 marks
1.1 To display last five rows of the Series object S you may write_________________. 1
a) head() b)head(5) c) tail() d) tail(5)
1.2 Which of these is not a communication channel? 1
a) Satellite b) Microwave c) Radio wave d) Wi-Fi
1.3 Patient analysis in the Delhi region is to be plotted. The command used to give title to the X-axis as 1
“No.of Patients” in the graph is:
a)plt.show() b)plt.plot(“No. of c)plt.xlabel(“No. of d)plt.title(“No.of
Patients”) Patients”) Patients”)
1.4 Which type of error is returned by the following statement? 1
Import pandas as pa
pa.Series([1,2,3,4], index = [ꞌaꞌ,ꞌbꞌ,ꞌcꞌ,])
a)Name Error b)Syntax Error c) Value Error d) Logical Error
1.5 PANDAS stands for: 1
a)Panel Data System b)Panel Data c)Pandas Data d)None of the above
Structures
1.6 A series by default have numeric data labels starting from 1
a)3 b)2 c)1 d)0
1.7 Which network topology requires a central controller or hub? 1
a)Star b)Bus c) Mesh d) Tree
1.8 CSV stands for: 1
a)Comma Separated b)Comma Separated c) Column Separated d)Column Separated
Values Variables Values Variables
1.9 Which of the following statement is False?
a)DataFrame is size b)DataFrame is values c)DataFrame is d)DataFrame is 1
mutable mutable immutable capable of holding
different types of data
1.10 The part of chart which identifies different sets of data plotted on a plot by using different colours is 1
called:
a)legends b)title c)axes d)figure
1.11 What is noise with respect to data transmission? 1
a)Cable disturbance b)Cable Shortage c) Loss of signal d) Unwanted signal
Strength with transmimssion
1.12 The data of any CSV file can be shown in which of the following software? 1
a)MS Word b)Notepad c) Spreadsheet d) All of the above
1.13 Which function is used to rename an existing column or index? 1
i)std() ii)hist() iii)groupby() iv)rename()
1.14 Each IP packet must contain : 1
a) Only source address b)Only destination c)Source and d) Source or
address destination address destination address

Q2 Very short questions: 14


2.1 Find the output of following program 2
import pandas as pd
s1=pd.Series(range(5))
print(s1)

2.2 import numpy as np 2


import pandas as pd
np_array = np.array([10, 20, 30, 40, 50])
print(np_array)
s1 = pd.Series(np_array)
print(s1)

2.3 Differentiate between: 2


(i) Hub and Switch
(ii) Gateway and Bridge

2.4 Identify the type of topology on the basis of the following: 2


i)Since every node is directly connected to the server, a large amount of cable is needed which
increases the installation cost of the network.
ii)It has a single common data path connecting all the nodes.

2.5 Write the output of the following code : 2


import numpy as np
array1=np.array([10,12,14,16,18,20,22])
print(array1[1:5:2])

2.6 Define web browser and web server (with examples). 2

2.7 What is data visualization? What is its significance? 2

Q3 Answer the following: 21


3.1 Write a code to plot the speed of a train as shown in the figure below: 3
Assume the values for x from 1 to 5 and the other axis is taken as 1.5x,3.0x and x/3.0

3.2 Name the function that you can use to iterate over DataFrames? Explain the basic difference between 3
them.

3.3 Write a code in python to find the maximum value in a DataFrame. Take list 3
item as an input from the user.

3.4 2. Create two dataframes using the following two Dictionaries. Merge the two dataframes and the 3
second dataframe as a new column to the first dataframe on the basis of the manufacturing company's
name.
Car_Price = ('Company': ['Toyota', 'Honda', 'BMW', 'Audi'], 'Price': [20000, 147955, 135925, 71400])
car_Horsepower = ('Company': [ 'Toyota', 'Honda', 'BMW', 'Audi'], 'horsepower': [140, 80, 185,
166]}
Expected Output:
Company Price horsepower
0 Toyota 20000 140
1 Honda 147955 80
2 BMW 135925 185
3 Audi 71400 166

Python Pandas merges two dataframes and appends the new dataframe as a new column.

3.5 Write a program to create a DataFrame to store weight, age and names of 5 people. Print the 3
DataFrame and its Transpose.

3.6 Complete the given code to get the following graph. 3

Import . pyplot as plt


data = [1,11,21,31,41]
plt. ([5,15,25,35,45,55], = [0,10,20,30,40,50,60],
= [20,10,45,33,6,8], ='red')
plt. ()

OR
3.6 To provide telemedicine faculty in a hilly state, a computer network is to be setup to connect 3
hospitals in 6 small villages (VI, V2, …, V6) to the base hospital (H) in the state capital. This is
shown in the following diagram. No village is more than 20 km away from the state capital.

Imagine yourself as a computer consultant for this project and answer the following questions with
justification:
i) Out of the following what kind of link should be provided to setup this network: Microwave link,
Radio Link, Wired Link?
ii) What kind of network will be formed; LAN, MAN, or WAN?
iii)Many times doctors at village hospital will have to consult senior doctors at the base hospital. For
this purpose, how should they contact them: using email, sms, telephone, or video conference?

3.7 Assume a DataFrame df1 that contains data about the climatic condition of different cities with 3
A1,A2,A3,A4 and A5 as indexes and give the output of the following questions:

City Maxtemp Mintemp Rainfall


A1 Delhi 40 32 24.1
A2 Bengaluru 31 25 36.2
A3 Chennai 35 27 40.8
A4 Mumbai 29 21 35.2
A5 Kolkata 39 23 41.8

i) >>>df1.loc[ꞌ A1ꞌ: ꞌA3 ꞌ, ꞌcity ꞌ]


ii)>>>df1.loc[2]
iii)>>>df1.city

OR
3.7 Give two advantages of each of the following: 3
i)Tree toplology
ii)Optical Fiber Cable
iii)LAN

Q4 Answer the following: 21


4.1 Assuming the given table : Product ,Give the code in Pandas for the following: 7
Item Company Rupees USD
TV LG 36000 484
TV VIDEOCON 25000 337
TV LG 33000 444
AC HITACHI 40000 538
i) To create the DataFrame for the above table.
ii)To add the new rows in the DataFrame.
iii) To display the maximum price of LG tv.
iv) To display the sum (USD)of all products.
v) To display the average of USD of LG Products.
vi) To sort the data according to the Rupees.
vii) To transfer the data to CSV.
4.2 Given a DataFrame df1 as shown below. Answer the following questions based on it. 7

C1 C2 C3
0 10 20 30
1 11 22 33
2 15 16 43
3 45 56 78
4 15 34 59

i)Write a code to create a new DataFrame df2 that stores the values of df1 multiplied by 3.
ii) Write code to add a column C4 in the DataFrame df2 which stores the difference of column C3
with column C4 from the DataFrame df2.
iii)Write code to drop the column C4 from the df2.The DataFrame should be modified after this
statement.
iv) Write code to drop the index 2 from the DataFrame df2.The DataFrame should be modified after
this statement.
v) Write code to display the sum of rows with indexes 2 onwards from the DataFrame df1.
vi)Write command to print the average value of each column of df2.
vii) Write a command to display the row storing the minimum value of column C2 of df2.
4.3 a)Describe the following with respect to computer network. 7
i)Dynamic Web Page
ii)Modem
iii)Server
b) How is Spam different from Junk mail?
c) Write the full form of URL. What is the importance of URL in Networking?
************************

You might also like