<jupyter_start><jupyter_text>Datasethttps://data.wprdc.org/dataset/allegheny-county-restaurant-food-facility-inspection-violations/resource/112a3821-334d-4f3f-ab40-4de1220b1a0a<jupyter_code>import pandas as pd

restaurants_all = pd.read_csv("r.csv")

query_mask = restaurants_all['status'] > 1
zip_mask_low = restaurants_all['zip'] > 14999.0
zip_mask_high = restaurants_all['zip'] < 16000.0
open_restaurants = restaurants_all[query_mask]
open_restaurants = open_restaurants[zip_mask_low]
open_restaurants = open_restaurants[zip_mask_high]
open_restaurants = open_restaurants[open_restaurants['zip'].notnull()]
open_restaurants.head(5)
zipcode_counter = dict()

for row in open_restaurants.index:
    zipc = open_restaurants.loc[row, "zip"]
    
    if zipc not in zipcode_counter:
        zipcode_counter[zipc] = 1
    else:
        zipcode_counter[zipc] = zipcode_counter[zipc] + 1

zipcode_counter
zip_sorted = dict(sorted(zipcode_counter.items(), key=lambda item: item[1]))
zip_sorted
#all_values = zipcode_counter.values()
#max_value = max(all_values)

#print(max_value)

max_key = max(zipcode_counter, key=zipcode_counter.get)
print(max_key)

min_key = min(zipcode_counter, key=zipcode_counter.get)
print(min_key)

print(len(zip_sorted))

zipcode_points_restaurants = dict()
i = 1

for key in zip_sorted:
    zipcode_points_restaurants[key] = i // 28 + 1
    i = i + 1
    
zipcode_points_restaurants<jupyter_output>139
{'fraction_non_alphanumeric': 0.11025280898876405, 'fraction_numerical': 0.032303370786516857, 'mean_word_length': 6.233502538071066, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '46231', 'license': 'Unlicense', 'n_tokens_mistral': 580, 'n_tokens_neox': 550, 'n_words': 81, 'path': '.ipynb_checkpoints/restaurant-checkpoint.ipynb', 'repo_name': 'GrayCleric4/Final-Project', 'size': '1424'}