Evaluate your skillset in Matplotlib
Data Science Slider

Evaluate your skillset in Matplotlib

Matplotlib is a data visualization and graphical plotting package for Python and its numerical extension NumPy that runs on all platforms. Matplotlib’s APIs (Application Programming Interfaces) can also be used to incorporate charts in graphical user interfaces. In most cases, a Python matplotlib script is constructed so that only a few lines of code are required to generate a visual data plot.

Let’s check the skillset associated with Matplotlib in Python. Try solving the following questions related to pyplot.

Q. To display a histogram with a well-defined edge, we can write

A. df.plot(type=’hist’,edge=’red’)

B. df.plot(type=’hist’,edgecolor=’red’)

C. df.plot(type=’hist’,line=’red’)

D. df.plot(type=’hist’,linecolor=’red’)

Q. Which plot is used to give a statistical summary

A. Bar

B. Line

C. Histogram

D. Box plot

Q. Which of the following is not the parameter of pyplot’s plot() method?

A. Marker

B. Lineheight

C. Linestyle

D. Color

Q. To compare data, we can use ____ chart

A. Line

B. Bar

C. Pie

D. Scatter

Q. Which of the following chart element is used to identify data series by their color patterns?

A. Chart title

B. Legend

C. Marker

D. Data Labels

Q. Which of the following is incorrect regarding Data Visualization?

A. The Matplotlib library in Python can be used to visualize data.

B. Visualizing enormous amounts of complex data does not yield useful results.

C. Data visualization is immensely useful in data analysis.

D. Data visualization is used by decision-makers to readily grasp corporate problems and develop strategies.

Q. Consider the code given below:

plt.bar(cities,population,color=[‘r’,’g’,’b’,’m’])

What will be the color of the last bar?

A. Magenta

B. Green

C. Blue

D. Black

Q. Mr.X has written the following code to create a bar chart

import matplotlib.pyplot as plt

day=[‘sun’,’mon’,’tue’]

sale=[1234,3541,2456]

plt.bar (day,sale)

But, when executing this code, he is not able to display any chart. What would you suggest to him to correct the code?

A. Instead of using bar() he should use plot() method

B. He should add show() function at the end of the code

C. He should be using a numpy array to store data

D. No suggestion required

Q. The best suitable real-life example of data visualization is

A. Percent of the population by age group in a countr4y

B. Google Analytics

C. Solar system drawing

D. Both A and B

Q. Which of the following is the correct syntax to create a histogram with bins specified?

A. plt.hist (x, bins=10)

B. plt.hist (x, bins=[10,11,12,13,14])

C. plt.hist (x, bins=range(10,15))

D. All are corrects

Through the data Science training institute in Kochi, you may develop your data science skills, become more familiar with the ideas, and practice more. To understand the lifespan of a Data Science project, the correct kind of training is essential, which can be obtained through the comprehensive course offered by the best Data Science training in Kochi.

Author: STEPS