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

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

# plot active power for each day of first 20 days in a month
days = [x for x in range(1, 11)]
pyplot.figure()
for i in range(len(days)):
    # prepare subplot
    ax = pyplot.subplot(len(days), 1, i+1)
    # determine the day to plot
    day = '2018-02-' + str(days[i]) # Feb or Aug
    # get all observations for the day
    result = dataset.loc[day]
    # plot the active power for the day
    #Net_total,Lighting,HVAC,Appliances,Sun_altitude,Air_Temp_outdoor,Air_Temp_room
    pyplot.plot(result['Net_Total'])
    #pyplot.plot(result['Lighting'])
    #pyplot.plot(result['HVAC'])
    #pyplot.plot(result['Appliances'])
    #pyplot.plot(result['Sun_altitude'])
    #pyplot.plot(result['Air_Temp_outdoor'])
    #pyplot.plot(result['Air_Temp_room'])
    # add a title to the subplot
    pyplot.title(day, y=0, loc='left')
    
pyplot.show()
