<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Set Up
Step1:  Import Energy Data
Energy data can be obtained from your DNSP as a NEM12 file.
Step2:  Timing Considerations
Energy billing data is reported by the meter at the end of the interval period. 
The energy reading on 2020-01-01T00
Step3:  Plot NMI Data
Step4:  Daily Profiles
<ASSISTANT_TASK:>
Python Code:
# Will allow us to embed images in the notebook
%matplotlib inline
Explanation: Set Up
End of explanation
# Import NEM12 data
from nemreader import output_as_data_frames
file_path = '../examples/example.csv'
dfs = output_as_data_frames(file_path)
nmi, df = dfs[0] # Get data for first NMI in file
nmi = '*Redacted*'
Explanation: Import Energy Data
Energy data can be obtained from your DNSP as a NEM12 file.
End of explanation
df.set_index('period_start', inplace=True)
df.tail()
Explanation: Timing Considerations
Energy billing data is reported by the meter at the end of the interval period. 
The energy reading on 2020-01-01T00:00 is actually for the last interval of the previous day/month/year.
That is 2019-12-31T23:30 to 2020-01-01T00:00 for a 30min interval reading.
So for analysis we want to report on interval start to ensure values are grouped properly.
End of explanation
#Show quick daily summary
import pandas as pd
import calplot
calplot.calplot(pd.Series(df.E1), daylabels='MTWTFSS')
# Technically we should probably use a bar chart since they are totals
month_totals = df.groupby(df.index.strftime('%Y-%m')).sum()
month_totals.plot(title=nmi+" Monthly kWh", kind='bar', y=['E1'])
# But a line chart resampled by month shows better date axis labels
month_totals = df.resample('M').sum()
month_totals.plot(title=nmi+" Monthly kWh", y=['E1'])
day_totals = df.resample('W').sum()
day_totals.plot(title=nmi+" Weekly kWh", y=['E1'])
Explanation: Plot NMI Data
End of explanation
hourly_avg = df.groupby(df.index.strftime('%H:%M')).mean()
hourly_avg.plot(title=nmi+" Avg Daily Profile", y=['E1'])
# Filter by summer months only 
summer_df = df.loc[df.index.month.isin([11, 12, 1, 2])]
summer_avg = summer_df.groupby(summer_df.index.strftime('%H:%M')).mean()
summer_avg.plot(title=nmi+" Avg Daily Profile (Hot Months)", y=['E1'])
# Filter by winter months only 
winter_df = df.loc[df.index.month.isin([5, 6, 7, 8, 9])]
winter_avg = winter_df.groupby(winter_df.index.strftime('%H:%M')).mean()
winter_avg.plot(title=nmi+" Avg Daily Profile (Cold Months)", y=['E1'])
Explanation: Daily Profiles
End of explanation
<END_TASK>