Visualisation
Plot from Pandas and choose the chart that answers the question.
What you will be able to do
- Use df.plot for quick charts.
- Choose bars for categories and lines for time.
- Label axes and units.
- Export at a readable size.
In plain English
A chart is an argument. A bar chart compares categories, a line chart shows change over time and a histogram shows a distribution. Label the axes and keep the palette restrained.
import pandas as pd
import matplotlib.pyplot as plt
df = pd.DataFrame({'course': ['HTML', 'CSS', 'SQL'], 'minutes': [12, 18, 9]})
ax = df.plot.bar(x='course', y='minutes', legend=False)
ax.set_ylabel('Minutes')
plt.tight_layout()
plt.savefig('minutes.png', dpi=150)Your turn
EasyMake a bar chart
Plot minutes by course as a bar chart without a legend.
PYTHON · starter
df.plot()Check your understanding before moving on.
Knowledge checkQuestion 1
Which chart best shows a trend over time?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.