QP - Ip PB19-01QP
QP - Ip PB19-01QP
SECTION- A
1.
(a) Find the output of following program. 1
import numpy as np
d=np.array([10,20,30,40,50,60,70])
print(d[-5:])
(b) State at least two differences between a numpy array and a list. 1
(c) Fill in the blank with appropriate statement using numpy method to calculate the covariance 2
and correlation coefficient of the two given 1D arrays(A,B)
import numpy as np
A=np.array([1,2,3,4,5])
B=np.array([3,4,0,-1,-4])
result_covar=______________ # COVARIANCE
result_coeff=______________ #CORRELATION COEFFICIENT
(d) What will be the output of the following python code: 2
import pandas as pd
import numpy as np
d = {'Student':['Ali','Ali','Tom','Tom'],\
'House':['Red',Red,'Blue',Blue’],\
'Points':[50,70,60,80]}
df =pd.DataFrame(d)
df1 = df.pivot_table(index='Student',columns='House',values=’Points’,aggfunc=np.sum)
print(df1)
(e) Given following ndarray A: 2
( [[2, 4, 6],
[7, 8, 9],
[1, 2, 3]] )
Write the python statements to perform the array slices in the way so as to extract
(i) First row (ii) Second Column
(f) Write a python statement to fill in the blanks so that the given output of is achieved: 2
import pandas as pd
import numpy as np
d = {'Rollno':[101,102,103,104],\
'ECO':[70,80,50,80],'BST':[60,50,60,90]}
df = pd.DataFrame(d)
df1 = ___________________________
print(df1)
Rollno 410
ECO 280
BST 260
dtype: int64
g) Fill in the blanks as per the three given options: 1
Skipna is a parameter in descriptive statistics when used with min() function
_______________ NA/null values when computing the result.
(i) include (ii) exclude (iii) does nothing with
h) Differentiate between apply() and applymap() functions 2
OR
Find the output for the following:
import pandas as pd
import numpy as np
d = {'Marks1':[10,20,30,40],\
'Marks2':[50,70,60,80]}
df=pd.DataFrame(d)
print(df)
print(df.apply(np.cumsum))
2.
a) For the given code fill in the blanks so that we get the desired output with sorting the 2
dataframe first on Quantity and second on Cost.
import pandas as pd
import numpy as np
d = {'Product':['Apple','Pear','Banana','Grapes'],\
'Quantity':[100,100,200,250],\
'Cost':[1000,1500,1200,900]}
df = pd.DataFrame(d)
df1 = ______________________________________
print(df1)
Product Quantity Cost
0 Apple 100 1000
1 Pear 100 1500
2 Banana 200 1200
3 Grapes 250 900
OR
For the given code fill in the blanks so that we get the desired output with maximum value for
Quantity and Average Value for Cost:
import pandas as pd
import numpy as np
d = {'Product':['Apple','Pear','Banana','Grapes'],\
'Quantity':[100,150,200,250],\
'Cost':[1000,1500,1200,900]}
df = pd.DataFrame(d)
df1 =_________________________________
print(df1)
Quantity 250.0
Cost 1150.0
dtype: float64
b) What is the use of pipe() function? 1
c) Consider the ndarrays Arr1 and Arr2 . 2
Arr1= array([[0,1,2],
[3,4,5],
[6,7,8]])
Arr2= array([[10,20,30],
[40,50,60],
[70,80,90]])
What will be the resultant array, if the following statement is given? np.hstack((Arr2,Arr1))
d) What do you mean by Linear regression? 2
Name the function that is used to train the model to perform Linear Regression analysis.
e) Draw a labled diagram of a vertical boxplot indicating names of all the summary information. 2
OR
What is the structure of a histogram if cumulative attribute is set to be True.
f) Consider the following dataframes : 2
df1 df2
mark1 mark2 mark1 mark2
0 10 15 0 30 20
1 40 45 1 20 25
2 15 30 2 20 30
3 40 70 3 50 30
Write the commands to do the following operations on the dataframes given above :
(i) To rename column mark1 as Score1 in both the dataframes df1 and df2.
(ii) To change index label of df1 from 0 to zero and from 1 to one.
g) What will be the output of the following code: 2
import matplotlib.pyplot as p
x=[6,7,8,9,10]
y=[60,40,55,30,70]
p.title('Secondary Class Strength')
p.xlabel('Class')
p.ylabel('No. of students')
p.bar(x,y)
p.show()
OR
Fill in the blank with appropriate pyplot methods:
import matplotlib.pyplot as p
Year=[2000,2002,2004,2006]
Rate=[21.0,20.7,21.2,21.6]
____________________________ # To draw a line graph
p.xlabel('Year')
p.ylabel('Rate')
p.title('Fuel Rates in every Two Year')
___________________(“Graph1.pdf”) # To save the graph
p.show()
What will be the output of the following code:
h) Write a python program to draw a bar chart with the following information: 4
City pollution
Kolkata 78
Delhi 91
Kanpur 88
Patna 90
Banglore 82
The bachart should have the following features:
a) X-axis label should be City and Y-axis label should be Pollution
b) The title of the chart should be Pollution Index
c) The colour of the bars should be Red
Use proper import statements in the program.
OR
Write a python program to draw a histogram with following information:
1 1 1 1 1 1 2 2 2 2 2 2 2
0 5 0 0 0 5 0 0 0 0 0 5 5
The histogram should have following information
a) X-axis label should be score and Y-axis should be Frequency
b) The title should be Frequency of Score
c) The colour of histogram should be blue with 10 bins
Use proper import statements in the program
SECTION- B
3.
a) What is meant by Software Engineering? 1
b) What is Software process? 3
Mention two advantages and two disadvantages of Waterfall model.
OR
Draw labelled diagram of Evolutionary Software process model
c) Mention two advantages of Incremental Software Delivery model. 2
OR
Mention two advantages of Spiral delivery model.
4.
a) “Working in a pair in Pair Programming increases efficiency and reduces time”. Justify. 1
b) Who is responsible for making sure that the Scrum has been understood and enacted and 1
also presides over the Scrum meeting?
c) What are Commit – Update in version control system 2
Or
What are Push-Pull requests in version control system
d) Draw a business use case diagram of the following scenario for a grocery shop 3
i) Customers can purchase goods
ii) Shop owner performs billing
iii) Inventory is updated after each transaction
e) Mention any two features of GIT. 2
OR
Who are actors in a Use-case diagram? Name the CRUD operations required in creating Use-
case diagrams.
SECTION- C
5.
a) Mention any two functions of manage.py in Django environment. 2
OR
Mention any two entries that are done in settings.py file in Django
b) Mention two differences between GET and POST methods 2
OR
Write the method used to read a CSV file.
Which command is used to activate virtual environment.
c) Mention one difference between fetchone() and fetchall() method. 1
d) The ‘STUDENT’ table is stored in the database ‘SCHOOL’ in MySQL. The database credentials 4
includes host as ‘localhost’, user as ‘root’ and password as ‘cloud’. Write python script to do
the following:
i. Import necessary modules to establish MySQL connectivity with Python
ii. Write a statement to establish connection to the database using given credentials
iii. Check the connectivity, whether connection OK or NOT OK.
iv. Write python statement to create a cursor object
v. Write python statement to close the connection
6.
a) i) What do you mean by cardinality and degree of a table? 1
ii) “Pay” is a column name for the Pay of staff in a table “Schools”. The SQL queries 1
SECTION- D
7.
a) Which of the following is NOT an intellectual property? 1
(i) A poem written by a poet
(ii) An original painting made by a painter
(iii) Trademark of a Company
(iv) A remixed song
b) Fill in the blanks: 1
An act of stealing others Intellectual Property without their consent of without citing the
source is called ____________
OR
Name the cyber law enforced in India to provide legal recognition to electronic commerce
and to facilitate filing of electronic records with the Government.____________
c) Give the full form of: i) GPL ii) OSS 1
d) Mention two benefits of e-waste recycling. 1
e) Suggest two measures to avoid Credit Card Fraud. 2
f) Differentiate between Public Domain Software and Proprietary Software. 2
g) Bit-coin is a kind of ____________________ 1
h) List any one disability issue faced in the teaching/using computers with respect to specially 1
abled students.
************