Multiple Choice Guestions
PyPlot is an interface of Python's library.
1. (d) matplotlib
(b) plotly (c) g8plot
(a) seaborn
interface is often used ?
Python library, which library
2. For 2D plotting using a
(c) matplotlib (d) matplotlib.pyplot
(a) seaborn (b) plotly
3. Which of the following is not a valid chart type ?
(d) box
(a) histogram (b) statistical (c) pie
function of pyplot ?
4 Which of the following is not a valid plotting
(a)plot() (b) bar( ) (c) line() (d)pie()
functions does not plot multiple data series ?
5 Which of the following plotting
(a) plot() (b) bar() () pie() (d)barh(
which tells the trend between two graphed variables is the graph/chart.
6. The plot
(a) line (b) scatter c) bar (d) pie
Chapter 3 PLOTTING WITH PYPLOT
241
7. The plot which tells the
correlation between tw0 variables which may not be
graph/chart. directly related is
a) line
(b) scatter (c) bar
8. A is
(d) pie
summarisation tool for discrete or continuous
a
data.
(a) quartile (b) histogram
9. A visual
(C)mean (d) median
representation of the statistical five number
(a) histogram summary of a
given dataset is known as .
() boxplot (b) frequency distribution
10.
(d) frequency polygon
Which of the following functions is used to create a line chart?
(a) line() (b) plot()
11.
(c) chart( ) () plotline)
Which of the
following function will produce a bar chart ?
() plot()
12.
(b)bar() c) plotbar() (d) barh( )
Which of the
following function will create a vertical bar chart ?
a) plot() (b) bar( )
13. Which of the
)plotbar() d)barh()
following function will create a horizontal bar chart?
(a) plot() (b) bar( ) ()plotbar() (d)barh()
14. To specify the
style of line as dashed, which argument of plot( ) needs to be set ?
(a) line
(b) width (C) style (d) linestyle
15. The
datapoints plotted on a
graph are called
(a) points (b) pointers C)marks (d) markers
16. A
_graph type is a of chart which
displays information as a series of data
by straight line segments. points connected
(a) line (6) bar (C) pie (d) boxplot
17. To create scatter charts
using plot( ), which argument is skipped ?
(a) marker (b) linestyle c) markeredgecolor (d) linewidth
18. In scatter( ), which is used to
argument specify the size of datapoints?
a) size (b) S (C) marker d) markersize
19. Which argument of bar( ) lets you set the thickness of bar ?
(a) thick (b) thickness )width (d) barwidth
20. Which function lets you set the title
of the plot?
(a)title() (b) plotitle() c) graphtitle() d) all of these
21. The command used to
give heading
a to a
graph is. ICBSE Sample Paper 2020-21]
(a) plt.show() () pltplot() c) plt.xlabel() (d) plt.title()
22. Which function would you use to set the limits for r-axis of the plot ?
(a) limits( ()xlimits( c) xlim() (d) lim()
23. Which function is used to show legends ?
(a) display() (b) show( ) (c) legend() (d) legends()
24. Which argument must be set with plotting functions for legend() to display the legends ?
(a) data (6) label (c) name (d) sequence
242
25. Which function is used to create a histogram
(c) hist( ) (d) histtype
(a) histo( (b) histogram()
?
26. Which argument in hist() is used to create a stacked bar type histogram
(d) barstacked
(a) histt (b) histtype () type
27. Which of the data series ?
following functions can
plot only one
(a) plot( ) (b) bar( ) (c) boxplot() (d) pie()
28 which argument must be provided to create wedges out of a pie chart
(a) label (b) autopct (c) explode (d) wedge
29
.Which argument should be set to display percentage share of each pie on a pie chart?
(a) label (b) autopct (c) explode (d) wedge
30. Which function creates a
boxplot ?
(a) box( ) (6) plot() (c) boxplot() (d) showbox( )
31. Which argument of boxplot( ) is used filled ?
to create a boxplot
(a) fill (b) box (c) patch_artist (d) patch
CHAPTER 3: PLOTTING WITH PYPLOT
Multiple Choice Questions
3. (b), (d) 4. (c) 5. (c) 6. (a)
1. (d) 2. (d)
9. (c) 10. (b) 11. (b), (d) 12. (b)
7. (b) 8. (b)
15. (d) 16. (a) 17. (b) 18. (b)
13. (d) 14. (d)
21. (d) 22. (c) 23. (c) 24. (b)
19. (c) 20. (a)
27. (d) 28. (c) 29. (b) 30. (c)
25. () 26. (b)
31. (c)
Multiple Choice Questions
1. A CSV file can take character as separator.
(a) (b)
(c) (d) \t
(e) only (a) all of these
(
2. In order to work with CSV
files from panda, you need to import, other than
,
pandas.
(a) .csv
(b) pandas.io
(C) newcsv
d) no extra package required
3. The correct statement to read from a CSV file in a dataframe is :
(a) <DF>.read_csv(<file>)
(b) <File>, read_csv( )(<DF>)
() DF> pandas.read(<file>)
=
(d) <DF> pandas.read_csv(<files>)
=
4. Which argument do you specify with read_csv( ) to specify a
(a) character
separator character ?
(b) char
(c) separator
(d) sep
5. To suppress first row as header, which of the following arguments is to be
(a) noheader = True given in read_csv( )?
(b) header = None
() skipheader = True
(d) header =Null
6. To read
specific number of rows from a CSV file, which
(a) rows = <n>
argument is to be given in read_csv( ) ?
(b) nrows = <n>
(c) n_rows = <n>
(d) number_rows = <n>
7. To skip first 5 rows of CSV file, which argument will you
(a) skiprows =5 give in read_csv() ?
(b) skip_rows = 5
(c) skip 5
(d) noread = 5
8. To skip 1st, 3rd and 5th row of CSV file, which argument will you give in
read csV)?
(a) skiprows = 1 13 I5
(b) skiprows =[1, 5, 1]
(c) skiprows =[1, 3, 5] (d) any of these
9. While reading from a CSV file, to use a column's values as index labels, argument given in
read_CSV()is:
(a) index
(b) index_col
(c) index_values (d) index_abel
10. While writing a dataframe onto a CSV file, which argument would you use in to_sql( ) for NaN
values' representation as NULL ?
(a) NaN = NULL NULL
(b) na_rep
=
(c) na_value = NULL NULL
(d) na =
11. Which of the following libraries let you establish a connection with a MySQL database from within
Pythan
(a) mysql.connector (b) Pymysql, sqlalchemy
(c) pandas (d) numpy
12. In pandas.read_sql (<A>, <B>), <A> is
(a) connection name (b) table name
(d) database name
(c) SQL query string
13. In pandas.read-sql (<A>, <B>), <B> is
(a) connection name (b) table name
(d) database name
(c) SQL query string
for index labels of a dataframe, argument is specified in
14. To suppress the creation of a column
to_sql().
False (b) index False =
(a) if_exists
=
index True (d) if_exists True =
(c) =
of dataframe in a table of MySQL, argument is used in to_sql( ).
the content
.
15. To append (b) if_exists = "append"
"Add"
(a) if_exists
=
(d) if_exists = append
(c) if_exists
=
Add
Multiple Choice Questions
1. ( 2. (d) 3. (d) 4. (d) 5. (b) 6. (b)
7. (a) 8. (c) 9. (b) 10. (b) 11. (a), (b) 12. (c)
13. (a) 14. (b) 15. (b)