Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

DATA505_PRP : Assignment 3

Instructions:

1. Point allocations for each question is given within brackets.


2. Total points : 20

==========================================================================

1. Write a python program to realize the functionalities below:

a. Convert 10 different positive decimal numbers entered by user into binary

equivalent and store their binary values into a file ‘binary_data.txt’ (2 points)

b. Read the file ‘binary_data.txt’ generated by question 1a , perform binary to

decimal conversion and print the result. (2 points)

c. Again collect 5 different positive decimal numbers entered by user into binary

equivalent and append their binary values into the same file ‘binary_data.txt’.

(1 point)

2. Given a polynomial expression below:


𝑁

𝑝(𝑥) = 𝑎0 + 𝑎1 𝑥 + 𝑎2 𝑥 + 𝑎3 𝑥 + ⋯ + 𝑎𝑁 𝑥 = ∑ 𝑎𝑛 𝑥 𝑛
2 3 𝑁

𝑛=0

a. Write a function compute_poly() to implement the above functionality.

(5 points)

b. Write a new function compute_poly_numpy() that implements the same logic

but uses NumPy arrays and array operations for its computations, instead of any

form of Python loop. (5 points)


3. A dataset matches.csv for IPL matches played is shared alongside this assignment.

Write python code to realize the following:

a. Read matches.csv file into pandas data frame, df1. Create a new data frame

variable df2 in the format specified below for 3 teams (Royal Challengers

Bangalore, Sunrisers Hyderabad, Mumbai Indians) : (2 points)

Total matches Total matches Win


Season year Team name percentage
played won

b. Write python code to represent data frame df2 visually using matplotlib. (2
points)

c. Perform data analysis using the information available in this dataset and
generate a plot for a minimum of three teams. (3 points)

(Hint: Aggregate a table similar to the one framed in question number 3a.)

d. Summarize your observation based on the analysis done using step (a) and step
(d). (3 points)

=========================================================

You might also like