Obesity infographics:
ipywidgets
package allows you to build basic
graphical user interfaces (GUIs) to explore your data in the
Notebookinteract
function in ipywidgets
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
mx = pd.read_csv('http://personal.tcu.edu/kylewalker/mexico.csv')
cols = ['mus09', 'pri10', 'sec10', 'ter10', 'gdp08']
def make_plot(x, y, title):
sns.lmplot(data = mx, x = x, y = y)
plt.title(title)
plt.show()
interact(make_plot, x = cols, y = cols, title = "Enter a plot title!")
Arguments used in interact()
correspond to the
following:
True
or False
)
returns a checkboxExperiment with the functions you’ve written this semester!