Your Roll No ..............
Your Roll No ..............
(c) Define the following along with Python functions 3. Attempt any four questions from Section 8.
to create them : (6)
4. Parts of a question must be answered together.
(i) Histogram
Assume numpy has been imported as np and pandas
(ii) Density plots
has been imported as pd.
(iii) Heatmap
P.T.O.
(500)
5482-A 2 5482-A 11
(b) Write the output of the following Python code: (such as a new drug) while the control group
receives nothing or an inactive placebo. The
(2)
a = np.array([[l, 2, 3], [4, 5, 6]]) researchers then study what happens to people in
each group.
print(a.ndim) +\
What kind of study is RCT - experiment or
print(a.shape) observational study? Give reason.
print(df.iloc[1]) Operations :
P.T.O.
5482-A 10 5482-A
print(df)
6. (a) Given the following objects in python: (5)
(i) np.arange(5)
df = pd.DataFrame(data)
(ii) np.arange(10,1,-2)
Write the output for the following Python code :
print(b*2)
(v) print(df.groupby(` Group').min())
print(a+b)
P.T.O.
5482-A 5482-A
(i) Find the mean and median of the following (ii) Set the color of the line as green and style
data : (4) as a dotted line.
P.T.O.
5482-A 5482-A
Write the output for the following Python code: Write Python code for the following operations :
(i) print(df.dropna())
(i) Create a DataFrame from the dictionary
data and assign it to a variable named df.
(ii) print(df.fillna(method=`fflll'))
5. (a) Given a DataFrame df_sales representing weekly (v) Select and print the `Name' and `City'
sales data for a retail store : (5) columns for all individuals.
P.T.0.
5482-A 5482-A
3. (a) Given the following Numpy array data : (5) 4. (a)Given a series data: (5)
(i) print(data[1,1])
(i) print(data[:])
(Height)2.
`8': [5, np.nan, np.nan, 8],
P.T.O.