In [1]:
from ahh import vis, pre

In [2]:
heart_df_pivot_fp = pre.join_cwd('data/heart_pivot.csv') # join directory to data
steps_df_pivot_fp = pre.join_cwd('data/steps_pivot.csv')

heart_df_pivot = pre.read_csv(heart_df_pivot_fp, date='Unnamed: 0')
steps_df_pivot = pre.read_csv(steps_df_pivot_fp, date='Unnamed: 0')

heart_df_pivot
steps_df_pivot # format required


Out[2]:
monday tuesday wednesday thursday friday saturday sunday
February 69.835851 70.534299 69.933559 68.228426 67.209839 69.064454 72.446892
March 74.365445 75.712638 73.227361 72.319531 70.449219 70.376027 73.172629
April 68.155923 68.337217 67.923949 69.087656 67.476282 67.184555 67.373059
May 67.931816 67.990133 70.416833 68.561770 69.631887 69.684483 68.003535
Out[2]:
monday tuesday wednesday thursday friday saturday sunday
February 16818 17003 16589 12693 15379 12143 16516
March 40506 33414 48867 48566 29951 25123 27904
April 40056 29216 35427 34266 38786 37417 25570
May 35470 37690 41014 30850 36566 40679 35541

In [3]:
vis.plot_heatmap(heart_df_pivot, # all that is necessary to plot
                 title='Heart Rate Average', cbar_label='BPM', # labeling
                 xrotation=90, cols=2, vmin=62, vmax=78, interval=2) # aesthetics and subplots
vis.plot_heatmap(steps_df_pivot,
                 title='Steps Sum', cbar_label='Steps',
                 xrotation=90, cols=2, pos=2, data_lim=(20000, 45000)
                 )


Out[3]:
<matplotlib.axes._subplots.AxesSubplot at 0x7f8b3905f940>
Out[3]:
<matplotlib.axes._subplots.AxesSubplot at 0x7f8b390cef98>

In [ ]:


In [ ]: