Professional Documents
Culture Documents
Innovative Worksheet For Python (Basics)
Innovative Worksheet For Python (Basics)
Innovative Worksheet For Python (Basics)
a. Identify the suitable code to be used in the blank space in line marked as Statement 1.
i. matplotlib as plt iii. pandas as pd
ii. numpy as np iv. matplotlib.pyplot as plt
b. What is the name of the function to plot the required bar graph in the line marked as
Statement 2?
i. hist ( ) iii. bar ( )
ii. pie ( ) iv. scatter ( )
c. Fill in the blank in Statement 3 to set chart Title as “Happiness Index across cities by
gender” and font size as 18.
i. plt.xtitle(“Happiness Index across cities by gender”, fontsize =18)
ii. plt.title(“Happiness Index across cities by gender”, fontsize =18)
iii. plt.ytitle(“Happiness Index across cities by gender”, fontsize =18)
iv. plt.show (“Happiness Index across cities by gender”, fontsize =18)
d. identify the suitable code for line marked as Statement 4 to display the legends as shown
in the plot.
i. plt.showlegend( ) iii. plt.display( )
ii. plt.legend( ) iv. plt. show( )
e. fill in the blank marked in Statement 5 to display the plot.
i. plt.plot( ) iii. plt. display( )
ii. plt.showplot( ) iv. plt.show( )
7. What is the purpose of matplotlib library?
8. What is the purpose of a legend?
9. What is a histogram? What is its usage/utility?
10.What is the significance of data visualization?
11.Compare bar( ) and barh( ) functions.
12.What are the advantages of CSV file formats?
13.By default, read_csv( ) uses the values of first row as column headers in data frames.
Which argument will you give to ensure that the top/first row’s data is used as data and
not as column headers?
14.Which argument would you give to read_csv( ) if you only want to read top 10 rows of
data?
15.What all libraries do you require in order to bring data from CSV file into a dataframe?