<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 This demo notebook shows how units are treated and how to apply unit conversions
Opengrid makes use of the python library pint for unit conversions
Step1:  Each Sensor object needs an attribute unit. For Fluksosensors, the units are as follows
Step2:  When we use the default unit, we get Watts.
Step3:  You can verify the unit of the obtained dataframe.  Each series has the attribute unit.  However, be aware that this attribute will disappear when you do operations on df.
Step4:  If you want to convert units youself, there is a practical function in opengrid.library.misc that computes the conversion factor to go from one unit to another.
<ASSISTANT_TASK:>
Python Code:
import pandas as pd
import charts
from opengrid.library import misc, houseprint 
Explanation: This demo notebook shows how units are treated and how to apply unit conversions
Opengrid makes use of the python library pint for unit conversions
End of explanation
hp = houseprint.Houseprint()
sensors = hp.search_sensors(type='electricity', system='solar')
head = pd.Timestamp('20150617')
tail = pd.Timestamp('20150621')
Explanation: Each Sensor object needs an attribute unit. For Fluksosensors, the units are as follows:
sensortype      unit
-----------------------
water       ==&gt; liter
gas         ==&gt; liter
electricity ==&gt; Wh
When you obtain data, always use the get_data() methods.  These are defined for object of type Houseprint, Device, Site and Sensor. Each of these calls allows you to specify 
a resampling rate ('raw', 'min', 'hour', ...)
whether differentiation is needed (to go from counter to flux values, eg from Wh to W)
a target unit
The default resulting unit for counter values (diff=False) are:
sensortype      unit
-----------------------
water       ==&gt; liter
gas         ==&gt; kWh
electricity ==&gt; kWh
The default resulting unit for flux values (diff=True) are:
sensortype      unit
-----------------------
water       ==&gt; liter/min
gas         ==&gt; W
electricity ==&gt; W
Let's look at some PV sensors.
End of explanation
df = hp.get_data(sensors=sensors, head=head, tail=tail)
charts.plot(df, stock=True, show='inline')
df = hp.get_data(sensors=sensors, head=head, tail=tail, resample='day', unit='kW')
charts.plot(df, stock=True, show='inline')
    
Explanation: When we use the default unit, we get Watts.
End of explanation
for col in df:
    print("The unit of the data for {} is {}".format(col, df[col].unit))
Explanation: You can verify the unit of the obtained dataframe.  Each series has the attribute unit.  However, be aware that this attribute will disappear when you do operations on df.
End of explanation
misc.unit_conversion_factor(source='liter/min', target='m**3/hour')
Explanation: If you want to convert units youself, there is a practical function in opengrid.library.misc that computes the conversion factor to go from one unit to another.
End of explanation
<END_TASK>