<jupyter_start><jupyter_text>More maps!This is a notebook for generating additional maps. For explanations of how to use the functions shown below, visit census_folium_viewer.py and census_folium_tutorial_v5.ipynb (or a later version, if one exists).<jupyter_code>import time
start_time = time.time()
import census_folium_viewer
import geopandas
import numpy as np
import pandas as pd
import folium
zip_and_census_table = geopandas.read_file('zip_and_census_table.geojson')
zip_and_census_table = zip_and_census_table.query("State != 72")

county_and_census_table = geopandas.read_file('county_and_census_table.geojson')
county_and_census_table = county_and_census_table.query("State != 72")

state_and_census_table = geopandas.read_file('state_and_census_table.geojson')
state_and_census_table = state_and_census_table.query("NAME != 'Puerto Rico'")
state_and_census_table.columns
state_pct_children_in_mcf_below_pl_map = census_folium_viewer.generate_map(
    merged_data_table = state_and_census_table,
    shape_feature_name = 'NAME',
    data_variable = 'Proportion_of_children_in_married_couple_families_below_poverty_level', 
    feature_text = 'State', 
    data_variable_text = '% of children in married-couple families below \
poverty level', 
    map_name = 'state_pct_children_in_mcf_below_pl', 
    html_save_path = r'C:\Users\kburc\D1V1\Documents\!Dell64docs\Programming\py\kjb3_programs\census_folium_tutorial',
    screenshot_save_path = 'census_folium_map_screenshots', 
    popup_variable_text = 'Percentage', fill_color = 'Blues', 
    rows_to_map = 0, bin_type = 'percentiles', bin_count = 8, 
    multiply_data_by = 100,
    variable_decimals = 2, vertical_legend = True)
state_pct_children_in_fcf_below_poverty_level = census_folium_viewer.generate_map(
    merged_data_table = state_and_census_table,
    shape_feature_name = 'NAME',
    data_variable = 'Proportion_of_children_in_female_householder_families_below_poverty_level', 
    feature_text = 'State', 
    data_variable_text = '% of children in female-householder families (with \
no spouse present) below poverty level', 
    map_name = 'state_pct_children_in_fhf_below_pl', 
    html_save_path = r'C:\Users\kburc\D1V1\Documents\!Dell64docs\Programming\py\kjb3_programs\census_folium_tutorial',
    screenshot_save_path = 'census_folium_map_screenshots', 
    popup_variable_text = 'Percentage', fill_color = 'Blues', 
    rows_to_map = 0, bin_type = 'percentiles', bin_count = 8, 
    multiply_data_by = 100,
    variable_decimals = 2, vertical_legend = True)
state_residents_with_bachelors_or_higher = census_folium_viewer.generate_map(
    merged_data_table = state_and_census_table,
    shape_feature_name = 'NAME',
    data_variable = "Proportion_of_individuals_25+_y/o_whose_highest_education_level_=_bachelor's_degree_or_higher", 
    feature_text = 'State', 
    data_variable_text = "% of individuals at least 25 years old whose highest \
education level is a bachelor's degree or higher", 
    map_name = 'state_pct_with_bachelors_or_higher', 
    html_save_path = r'C:\Users\kburc\D1V1\Documents\!Dell64docs\Programming\py\kjb3_programs\census_folium_tutorial',
    screenshot_save_path = 'census_folium_map_screenshots', 
    popup_variable_text = 'Percentage', fill_color = 'PuOr', 
    rows_to_map = 0, bin_type = 'percentiles', bin_count = 8, 
    multiply_data_by = 100,
    variable_decimals = 2, vertical_legend = True)<jupyter_output><empty_output><jupyter_text>"Proportion_of_individuals_25+_y/o_whose_highest_education_level_=_bachelor's_degree_or_higher" 'Proportion_of_children_in_married_couple_families_below_poverty_level','Proportion_of_children_in_female_householder_families_below_poverty_level',<jupyter_code>county_residents_with_bachelors_or_higher = census_folium_viewer.generate_map(
    merged_data_table = county_and_census_table,
    shape_feature_name = 'County',
    data_variable = "Proportion_of_individuals_25+_y/o_whose_highest_education_level_=_bachelor's_degree_or_higher", 
    feature_text = 'County', 
    data_variable_text = "% of individuals at least 25 years old whose highest \
education level is a bachelor's degree or higher", 
    map_name = 'county_pct_with_bachelors_or_higher', 
    html_save_path = r'C:\Users\kburc\D1V1\Documents\!Dell64docs\Programming\py\kjb3_programs\census_folium_tutorial',
    screenshot_save_path = 'census_folium_map_screenshots', 
    popup_variable_text = 'Percentage', fill_color = 'PuOr', 
    rows_to_map = 0, bin_type = 'percentiles', bin_count = 8, 
    multiply_data_by = 100,
    variable_decimals = 2, vertical_legend = True)
zip_residents_with_bachelors_or_higher = census_folium_viewer.generate_map(
    merged_data_table = zip_and_census_table,
    shape_feature_name = 'ZCTA5CE20',
    data_variable = "Proportion_of_individuals_25+_y/o_whose_highest_education_level_=_bachelor's_degree_or_higher", 
    feature_text = 'zip', 
    data_variable_text = "% of individuals at least 25 years old whose highest \
education level is a bachelor's degree or higher", 
    map_name = 'zip_pct_with_bachelors_or_higher', 
    html_save_path = r'C:\Users\kburc\D1V1\Documents\!Dell64docs\Programming\py\kjb3_programs\census_folium_tutorial',
    screenshot_save_path = 'census_folium_map_screenshots', 
    popup_variable_text = 'Percentage', fill_color = 'PuOr', 
    rows_to_map = 0, bin_type = 'percentiles', bin_count = 8, 
    multiply_data_by = 100,
    variable_decimals = 2, vertical_legend = True)
end_time = time.time()
run_time = end_time - start_time
run_minutes = run_time // 60
run_seconds = run_time % 60
print("Completed run at",time.ctime(end_time),"(local time)")
print("Total run time:",'{:.2f}'.format(run_time),
"second(s) ("+str(run_minutes),"minute(s) and",'{:.2f}'.format(run_seconds),
"second(s))") 
# Only meaningful when the program is run nonstop from start to finish<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08818043072748856, 'fraction_numerical': 0.014074953366118366, 'mean_word_length': 6.281481481481482, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, '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': '517621', 'license': 'MIT', 'n_tokens_mistral': 2278, 'n_tokens_neox': 2067, 'n_words': 334, 'path': 'script_backups/backup_more_maps.ipynb', 'repo_name': 'kburchfiel/census_folium_tutorial', 'size': '5897'}