<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Load fake data into a pandas DataFrame.  Use the dt column an the index for the DataFrame
Step1:  Convert the type column to a category (similar to factor in R)
Step2:  Plot the noise readings as a point plot
Step3:  Plot the pump state changes as a line plot.
Step4:  from notes found here
<ASSISTANT_TASK:>
Python Code:
raw_data = {'dt': ['2017-01-15 00:06:08', 
                   '2017-01-15 01:09:08', 
                   '2017-01-16 02:07:08', 
                   '2017-01-16 02:07:09', 
                   '2017-01-16 03:04:08', 
                   '2017-01-16 03:04:09', 
                   '2017-01-15 01:06:08'],
        'type': ['VOLT', 
                 'VOLT', 
                 'PUMP', 
                 'PUMP', 
                 'PUMP', 
                 'PUMP', 
                 'VOLT'],
        'value': [22.4, 
                  34.3,
                  0.,
                  1.,
                  1.,
                  0.,
                  34.3]}
df = pd.DataFrame(raw_data, index=raw_data['dt'], columns = ['type', 'value'])
df
Explanation: Load fake data into a pandas DataFrame.  Use the dt column an the index for the DataFrame
End of explanation
df.type = df.type.astype('category')
Explanation: Convert the type column to a category (similar to factor in R)
End of explanation
plt.figure()
df[df.type=='VOLT'].plot(rot=90,title='NoiseReading',style='o')
plt.show()
plt.savefig('DataFramePlotting01.png')
Explanation: Plot the noise readings as a point plot
End of explanation
plt.figure()
df[df.type=='PUMP'].plot(rot=90,title='Pump State',style='-')
plt.show()
plt.savefig('DataFramePlotting02.png')
Explanation: Plot the pump state changes as a line plot.
End of explanation
group = df.groupby(['type'])
group.plot()
plt.show()
plt.savefig('DataFramePlotting03.png')
fig, axs = plt.subplots(1,2,sharex=False)
group.get_group("PUMP").plot(ax=axs[0], y='value', rot=90,title='Pump State',style='-')
group.get_group("VOLT").plot(ax=axs[1], y='value', rot=90,title='Volt Noise',style='.')
plt.show()
plt.savefig('DataFramePlotting04.png')
Explanation: from notes found here:
http://matplotlib.org/examples/pylab_examples/subplots_demo.html
http://stackoverflow.com/questions/4270301/matplotlib-multiple-datasets-on-the-same-scatter-plot
http://stackoverflow.com/questions/21654635/scatter-plots-in-pandas-pyplot-how-to-plot-by-category
End of explanation
<END_TASK>