<jupyter_start><jupyter_text>Now You Code 2: Syracuse Crime DataIn this second now you code you will explore the plot.ly engine in detail using Syracuse, NY FBI crime data.<jupyter_code>!pip install cufflinks
!pip install folium
import plotly.plotly as py    
import plotly.graph_objs as go  
import cufflinks as cf
import pandas as pd
crime = pd.read_csv('https://raw.githubusercontent.com/mafudge/datasets/master/crime/syracuse-crime-data-1985-2012.csv')
crime.sample(10)
# Make a line plot of population over the years, using cufflinks crime.iplot()
# set the titles on x "Year, Y "Population" and cart title " Syracuse Population" 
# TODO: replace the ???? with appropriate values to render the chart
crime.iplot(kind = 'scatter', x = 'Year', y = 'Population', title='Syracuse Population',xTitle='Year',yTitle='Population')
# Step 1:
# Now plot the same thing using plot.ly without cufflinks, again filling in the templates. Using plot.ly takes more effort but
# you have more control / flexibility over how the plots are rendered.
plot_data = [
    go.Scatter(x=crime['Year'], y=crime['Population'], mode="lines+markers", name="Syracuse Population", marker=dict(color='red')),
]

py.iplot({ 'data': plot_data,
            'layout': {
               'title': 'Syracuse Population',
               'xaxis': {
                 'title': 'Year'},
               'yaxis': {
                'title': 'Population'}
        }})
# Step 2:
# Now create a line plot of "Robbery rate" versus "Motor vehicle theft rate" over time.
# NOTE: you will need two series in your plot_data 


plot_data = [
    go.Scatter(x=crime['Year'], y=crime['Motor vehicle theft rate'], y=crime['Robbery rate'], mode="lines+markers", name="Syracuse Population", marker=dict(color='red')),
]

py.iplot({ 'data': plot_data,
            'layout': {
               'title': 'Syracuse Population',
               'xaxis': {
                 'title': 'Years'},
               'yaxis': {
                'title': 'Crimes'}
        }})<jupyter_output><empty_output><jupyter_text>Interactive PlotsFinally write a program to ask for a crime metric like "Robbery" / "Burglary" / "Manslaughter" etc as input, then renders a plot of that metric over time as output !Note: check to make sure the entered crime metric is in the list of Pandas columns before you attempt to plot. It might be a good idea to print the column names before you plot.if it is not you should print "That is not a crime metric"  Step 3: Problem AnalysisInputs:Outputs:Algorithm (Steps in Program):<jupyter_code>## Step 4: Write code here<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11307692307692307, 'fraction_numerical': 0.0057692307692307696, 'mean_word_length': 3.571177504393673, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '16223', 'license': 'MIT', 'n_tokens_mistral': 814, 'n_tokens_neox': 752, 'n_words': 285, 'path': 'content/lessons/13/Now-You-Code/NYC2-Syracuse-Crime.ipynb', 'repo_name': 'MahopacHS/spring2019-zelleyt0309', 'size': '2600'}