The document contains a series of case study-based questions focused on data visualization using Python's matplotlib and numpy libraries. It includes multiple-choice questions regarding the correct syntax and functions to use for plotting bar charts and histograms, as well as handling data with pandas. Each question is followed by the correct answer, providing a practical understanding of data visualization techniques.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
9 views3 pages
Case Study Based Questions On Data Visualization
The document contains a series of case study-based questions focused on data visualization using Python's matplotlib and numpy libraries. It includes multiple-choice questions regarding the correct syntax and functions to use for plotting bar charts and histograms, as well as handling data with pandas. Each question is followed by the correct answer, providing a practical understanding of data visualization techniques.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3
Case Study Based Questions on data visualization
1. Consider the following program and answer any four question
from (i) to (v) : import _______ as plt plt.bar ([2,3,4,8,1],[2,4,7,3,5], label= _____ ) plt.legend( ) plt.xlabel(____ ) plt.ylabel(‘Height’) plt._______ (‘Vertical Bar Chart’) (i) Which Module will be imported in Line 1 for above code ? (a) matplotlib (b) matplotlib.pyplot (c) plotlib (d) None of these Ans: (b) (ii) Name the label that can be used to represent the bar chart in Line 2 . (a) Data (b) Data Values (b) Values for X axix (d) All of these Ans: (d) (iii) Which message is best suited for xlabel ? (a) X values (b) Y values (c) Legend (d) Vertical Ans: (a) (iv) Which method will take place at Line 6 for setting heading on the top of Chart ? (a) Title() (b) title() (c) Head() (d) All of these. Ans: (a) (v) Choose the statement to be place at Line7 of the above code . (a) Plt.print() (b) plt.show() (c) Plt.display() (d) plot.show() Ans: (b) 2. If you are given to plot a histogram using numpy array as per the code given below then answer any of four questions from (i) to (v) from matplotlib import _____ as plt Impot numpy as np fig, ax = plt.______ (1, 1) a= np.array([26,59,44,39,76,16,23,11,18,78]) ax.hist(a, bins=[0,10,20,30,40]) ax._____ (‘Histogram’) ax.set_xticks ([0,10,20,30,40, ]) ax.set_xlabel(‘Percentage’) ax._______ (‘Students’) ______ (i) Choose the correct option to import for given propgram: (a) matplotlib (b) matplot (c) pyplot (d) plot Ans: (c) (ii) Fill in the blank at Line 3 (a) subplots (b) subplot (c) plot (d) subplt Ans: (a) (iii) Which statement is used to set title in Line 6 ? (a) title (b) set_title (c) set (d) Title Ans: (b) set_title (iv) How to set Y-axis label ? (a) label() (b) set_y (c) set_ylab () (d) set_ylabel Ans: (d) set_ylabel (v) To fill in blank on Line 10 for showing histogram what can bee used ? (a) plt.show() (b) plt_show() (c) plot_show() (d) plt.show Ans: plt.show() 3. Consider the following case and answer the from (i) to (v) import …………. as pd import matplotlib. _____ as plt data= {‘Name’ : [‘Karan’, ‘Adi’, ‘Abhinav’, ‘Kirti’, ‘Rahul’ ], ‘Height’ : [60,61,63,65,61], ‘Weight’ : [47,89,52,58,50,47]} df=pd. _________ (data) df._____ (Kind =’hist’, edgecolor = ‘Green’, linewidth =2, linestyle=’:’ , fill= False) _____________ (i) Fill in the blank in Line 1. (a) numpy (b) pandas (c) Python (d) matplot Ans: (b) pandas (ii) Fill in the blank in Line 2. (a) pyplot (b) plot (c) pyp (d) None of these Ans: (a) pyplot (iii) Which of the following is used in Line 6 to represent the data ? (a) Series (b) Matplot (c) DataFrame (d) Plot Ans: (c) DataFrame (iv) For blank of Line 7 command used may be : (a) plt (b) pyplot (c) plot (d) figure Ans: (c)plot (v) To show the above graph , which statement is used in Line 8 ? (a) plot.show (b) plot.show() (c) plt.show (d) plt.show() Ans: (d) plt.show()