Sarvajanik College of Engineering and Technology, Surat
Computer Engineering Department
B.E. III, Sem. V
PROGRESSIVE ASSESSMENT 2
Subject Code: 3150713 Date: 3/10/2020
Subject Name: Python for Data Science
Time: 1.00 PM to 2.00 PM Total Marks: 20
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
Q.1 [A] Do as directed. Marks
1. What will be the output in this case: [1]
thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
print(thisdict)
print(len(thisdict))
2. For a company “ABC”, create the daily sales values randomly for one week [3]
span. Create a dataframe having sales values, index as date and column
heading as ‘Daily Sale’. Plot a line graph for this weekly sale. Also create a
trend line over the plot to see the direction of the sale.
Q:1 [B] Attempt ANY TWO questions. [6]
1. Explain the boxplot. For what kind of analysis a boxplot is preferred?
2. Write a python program to create a dictionary having 3 items using:
a) constructor
b) two lists
3. Mention the characteristics of a python set. Write a program to add
elements to a set using any two methods.
1
Q:2[A] Explain different forms and locations of data. [2]
Q:2 [B] Attempt the ANY TWO questions.
1. Enlist and explain different styles of Jupyter Notebook . [4]
2. Write a python program to read name of the file from the user and perform [4]
the following operations on it. (Read the file name "subjects.txt" from the
user)
1. Print the 75% records of the file. Read percentage from the user.
2. Print every 4th row of the file.
3. Write the output of the step 2 into the new file named subset1.txt
The contents of the subjects.txt file are as follows:
3. a) Define and explain Magic methods with an example. [2]
b) Write a python program to render an image from the url given [2]
below. Also print the shape and size of the image.
URL : “https://en.wikipedia.org/wiki/File:Pandit_DinDayal_Upadhyay_Indoor_Stadium,Surat.jpg”
*************