<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Loading data into memory
Loading API is central to a lot of nilmtk operations and provides a great deal of flexibility. Let's look at ways in which we can load data from a NILMTK DataStore into memory. To see the full range of possible queries, we'll use the iAWE data set (whose HDF5 file can be downloaded here).
The load function returns a generator of DataFrames loaded from the DataStore based on the conditions specified. If no conditions are specified, then all data from all the columns is loaded.  (If you have not come across Python generators, it might be worth reading this quick guide to Python generators.)
NOTE
Step1:  Let us see what measurements we have for the fridge
Step2:  Loading data
Load all columns (default)
Step3:  Load a single column of power data
Use fridge.power_series() which returns a generator of 1-dimensional pandas.Series objects, each containing power data using the most 'sensible' AC type
Step4:  or, to get reactive power
Step5:  Specify physical_quantity or AC type
Step6:  To load voltage data
Step7:  Loading by specifying AC type
Step8:  Loading by resampling to a specified period
<ASSISTANT_TASK:>
Python Code:
from nilmtk import DataSet
iawe = DataSet('/data/iawe.h5')
elec = iawe.buildings[1].elec
elec
Explanation: Loading data into memory
Loading API is central to a lot of nilmtk operations and provides a great deal of flexibility. Let's look at ways in which we can load data from a NILMTK DataStore into memory. To see the full range of possible queries, we'll use the iAWE data set (whose HDF5 file can be downloaded here).
The load function returns a generator of DataFrames loaded from the DataStore based on the conditions specified. If no conditions are specified, then all data from all the columns is loaded.  (If you have not come across Python generators, it might be worth reading this quick guide to Python generators.)
NOTE: If you are on Windows, remember to escape the back-slashes, use forward-slashs, or use raw-strings when passing paths in Python, e.g. one of the following would work:
python
iawe = DataSet('c:\\data\\iawe.h5')
iawe = DataSet('c:/data/iawe.h5')
iawe = DataSet(r'c:\data\iawe.h5')
End of explanation
fridge = elec['fridge']
fridge.available_columns()
Explanation: Let us see what measurements we have for the fridge:
End of explanation
df = next(fridge.load())
df.head()
Explanation: Loading data
Load all columns (default)
End of explanation
series = next(fridge.power_series())
series.head()
Explanation: Load a single column of power data
Use fridge.power_series() which returns a generator of 1-dimensional pandas.Series objects, each containing power data using the most 'sensible' AC type:
End of explanation
series = next(fridge.power_series(ac_type='reactive'))
series.head()
Explanation: or, to get reactive power:
End of explanation
df = next(fridge.load(physical_quantity='power', ac_type='reactive'))
df.head()
Explanation: Specify physical_quantity or AC type
End of explanation
df = next(fridge.load(physical_quantity='voltage'))
df.head()
df = next(fridge.load(physical_quantity = 'power'))
df.head()
Explanation: To load voltage data:
End of explanation
df = next(fridge.load(ac_type='active'))
df.head()
Explanation: Loading by specifying AC type
End of explanation
# resample to minutely (i.e. with a sample period of 60 secs)
df = next(fridge.load(ac_type='active', sample_period=60))
df.head()
Explanation: Loading by resampling to a specified period
End of explanation
<END_TASK>