<jupyter_start><jupyter_text>Create subset of complaints related to garbage<jupyter_code>garbagetypes = ['Overflowing or Un-kept Dumpster',
                'Improper Storage of Trash (Barrels)',
                'Missed Trash/Recycling/Yard Waste/Bulk Item',
                'Trash on Vacant Lot',
                'Illegal Dumping']
garbage = three11[three11.TYPE.isin(garbagetypes)]
garbage.to_csv('C:/Data/AnalyzeBoston/data/311_garbage.csv', index=False)<jupyter_output><empty_output><jupyter_text>Create subset of garbage-related complaints from move-in week (Aug. 29-Sept. 4)<jupyter_code>garbage2016 = garbage[garbage['open_dt'].dt.year == 2016]
moveinweek = garbage2016[(garbage2016['open_dt'] >= pd.datetime(2016, 8, 29)) &
                (garbage2016['open_dt'] < pd.datetime(2016, 9, 5))]
moveinweek.to_csv('C:/Data/AnalyzeBoston/data/311_garbage_moveinweek_2016.csv', index=False)<jupyter_output><empty_output><jupyter_text>Plot garbage complaints by week for the year 2016<jupyter_code>garbage2016 = garbage2016.set_index('open_dt')
ax = garbage2016.resample('W').size().plot(title="311 complaints for garbage by week (2016)")
ax.set_xlabel('Week')<jupyter_output><empty_output><jupyter_text>Download photos of garbage submitted with 311 complaints during moving week<jupyter_code>moveinweek = pd.read_csv('C:/Data/AnalyzeBoston/data/311_garbage_moveinweek_2016.csv')
picture = urllib.URLopener()
picturelist = []
for index, row in moveinweek.iterrows():
    url = str(row['SubmittedPhoto'])
    filename = str(row['CASE_ENQUIRY_ID'])
    picturelist.append([url, filename])
for item in picturelist:
    if item[0] != "nan":
        url = item[0]
        filename = "C:/Data/AnalyzeBoston/photos/%s.jpg" % item[1]
        picture.retrieve(url, filename)<jupyter_output><empty_output><jupyter_text>Create subset of 311 complaints for rodents and pests<jupyter_code>three11.TYPE.unique()
pesttypes = ["Rat Bite",
             "Pigeon Infestation",
             "Rodent Activity",
             "Bed Bugs",
             "Pest Infestation - Residential",
             "Mice Infestation - Residential"]
pests = three11[three11.TYPE.isin(pesttypes)]
pests2016 = pests[pests['open_dt'].dt.year == 2016]
moveinweekpests = pests2016[(pests2016['open_dt'] >= pd.datetime(2016, 8, 29)) &
                (pests2016['open_dt'] < pd.datetime(2016, 9, 5))]
moveinweekpests.to_csv('C:/Data/AnalyzeBoston/data/311_pests_moveinweek_2016.csv', index=False)
moveinweekpests.groupby(moveinweekpests['TYPE']).size()
pests2016 = pests2016.set_index('open_dt')
ax = pests2016.resample('W').size().plot(title="311 complaints for rodents/pests by week (2016)")
ax.set_xlabel('Week')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13713862120088954, 'fraction_numerical': 0.05707931801334322, 'mean_word_length': 4.8043010752688176, 'pattern_counts': {'":': 1, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '197879', 'license': 'CC-BY-3.0', 'n_tokens_mistral': 1062, 'n_tokens_neox': 905, 'n_words': 161, 'path': 'notebooks/311 service requests.ipynb', 'repo_name': 'jhaddadin/trashcity', 'size': '2698'}