# monthly line plots
from pandas import read_csv
from matplotlib import pyplot

# load the new file
dataset = read_csv('HondaHome2018_NET_POWER_Hourly.csv', 
                   header=0, 
                   infer_datetime_format=True, 
                   parse_dates=['datetime'], 
                   index_col=['datetime'])

# plot active power for each month
months = [x for x in range(1, 13)]
pyplot.figure()
for i in range(len(months)):
    # prepare subplot
    ax = pyplot.subplot(len(months), 1, i+1)
    # determine the month to plot
    month = '2018-' + str(months[i])
    # get all observations for the month
    result = dataset.loc[month]
    # plot the active power for the month
    pyplot.plot(result['Net_Total'])
    #pyplot.plot(result['HVAC'])
    # add a title to the subplot
    pyplot.title(month, y=0, loc='left')
pyplot.show()
    
