Member-only story

Interview Question: Create a simple bar chart

Crystal X
2 min readApr 17, 2023

--

An individual going on an interview in one of the various data science positions is going to be asked questions to determine how well he or she knows the subject.

One such question an applicant can be asked is to create a simple bar chart where the X axis has the names of fruits and the y axis has the costs of fruits.

There are numerous graphics libraries in Python, but perhaps the most common library is matplotlib. Matplotlib is a comprehensive library for creating static, animated, and interactive visualisations in Python.

Below is the code to create a simple bar chart of two lists using matplotlib:-

In addition to creating a vertical bar chart, matplotlib can also create horizontal bar charts.

The code below illustrates how to create a bar chart from two lists using matplotlib:-

Pandas is a software library written for the Python programming language for data manipulation and analysis. In particular, it…

--

--

Crystal X
Crystal X

Written by Crystal X

I have over five decades experience in the world of work, being in fast food, the military, business, non-profits, and the healthcare sector.

No responses yet