Back to main.

Calmcode Shorts

drawdata.py logodrawdata.py

Sometimes it can really be useful to draw your own dataset, especially when you're teaching or trying to understand a numeric concept yourself. For these use-cases, you may want to give drawdata a try.

When you run it in a notebook, you can draw your own dataset by hand. Here's a simple example on how to call the widget.

from drawdata import ScatterWidget

widget = ScatterWidget()
widget

Once you've draw a dataset you can access it easily via the different data attributes. Here a shorthand example for retreiving the data as a pandas dataframe.

import matplotlib.pylab as plt

df = widget.data_as_pandas
plt.scatter(df['x'], df['y'], color=df['color'])

Drawing your own dataset can be great fun, so feel free to give this library a spin!


Back to main.