How to create a bar chart like below chart for below question using Python?
Question: plot job role based on number of individuals who have have master degree AND earn <=50K in the United States
My table is below which I have imported from CSV file.
Degree job rol Country earning Bachelor Admin US. <=50k Master HR. England >=50k
I tried many ways. But could not do it
You can import the
matplotlib.pyplot as plt
and importnumpy as np
to make a bar graph. Create an array calledy = np.array([...])
for example, and create a function calledplt.bar()
. From there, you can fill in the height and your y variable to create a graph as you desire. Finally, just typeplt.show()
to display the graph.