OpenSesame
Rapunzel Code Editor
DataMatrix
Support forum
Python Tutorials
MindProbe
Python videos

Plotting: Exercises and Solutions

from matplotlib import pyplot as plt
from datamatrix import io, operations as ops

dm = io.readxlsx('data/movies.xlsx')
dm = (dm.year >= 1990) & (dm.year < 2000)
for year, year_dm in ops.split(dm.year):
    plt.plot(sorted(year_dm.rating), label=year)
plt.legend(title='Year')
plt.ylabel('Rating')
plt.xlabel('Movie #')
plt.show()

Output:

/home/sebastiaan/anaconda3/envs/pydata/lib/python3.10/site-packages/datamatrix/py3compat.py:105: 
UserWarning: Some rows miss column title
  warnings.warn(safe_str(msg), *args)
â ¦ Generating...

You're done with this section!

Continue with Plotting >>