import pandas as pd
pd.set_option('display.max_columns', 15)
pd.set_option('display.width', 400)
pd.set_option('display.mpl_style', 'default')
rcParams['figure.figsize'] = (14, 11)
import matplotlib
font = {'weight' : 'bold',
'size' : 22}
matplotlib.rc('font', **font)
member_data = pd.read_csv("./membership.csv", index_col='date', parse_dates=True)
member_data[:15]
members | dues | associate | full | student | other | |
---|---|---|---|---|---|---|
date | ||||||
2011-01-01 | 22 | 1065 | 1 | 17 | 1 | 0 |
2011-02-01 | 25 | 1110 | 0 | 21 | 0 | 0 |
2011-03-01 | 28 | 1195 | 0 | 19 | 1 | 0 |
2011-04-01 | 24 | 1195 | 0 | 19 | 1 | 0 |
2011-05-01 | 24 | 1190 | 0 | 18 | 1 | 0 |
2011-06-01 | 27 | 1280 | 0 | 20 | 1 | 0 |
2011-07-01 | 26 | 1245 | 0 | 19 | 2 | 0 |
2011-08-01 | 26 | 1195 | 2 | 18 | 2 | 0 |
2011-09-01 | 24 | 1125 | 2 | 17 | 1 | 0 |
2011-10-01 | 24 | 1155 | 1 | 17 | 0 | 0 |
2011-11-01 | 23 | 1060 | 2 | 17 | 0 | 0 |
2011-12-01 | 23 | 1060 | 2 | 16 | 0 | 0 |
2012-01-01 | 21 | 990 | 2 | 13 | 0 | 0 |
2012-02-01 | 22 | 1085 | 1 | 15 | 0 | 0 |
2012-03-01 | 22 | 1070 | 1 | 16 | 0 | 0 |
15 rows × 6 columns
member_data[['members', 'dues', 'associate']].plot(subplots=True)
array([<matplotlib.axes.AxesSubplot object at 0x7f05d00408d0>, <matplotlib.axes.AxesSubplot object at 0x7f05cbdf4590>, <matplotlib.axes.AxesSubplot object at 0x7f05cbd70490>], dtype=object)
member_data[['associate', 'full', 'student', 'other']].plot(subplots=True)
array([<matplotlib.axes.AxesSubplot object at 0x7f05cb5e54d0>, <matplotlib.axes.AxesSubplot object at 0x7f05cb914110>, <matplotlib.axes.AxesSubplot object at 0x7f05cb5a1f10>, <matplotlib.axes.AxesSubplot object at 0x7f05cbc0ff10>], dtype=object)
member_data.median()
members 28.0 dues 1310.0 associate 2.0 full 19.5 student 1.0 other 0.0 dtype: float64
member_data.max()
members 43 dues 1710 associate 13 full 27 student 4 other 1 dtype: float64
member_data.min()
members 21 dues 981 associate 0 full 13 student 0 other 0 dtype: float64