<jupyter_start><jupyter_text>countyraid experiments Get the data<jupyter_code>import json
import os
fileName = !awk -F "[= ]" '/COUNTY_CASES_US_FILE=/ { print($3); }' "../refreshdata.config"
fileName = fileName[0].replace('"', '')
fileName = os.path.join('..', fileName)
fileName
with open(fileName, 'r') as inputUS:
    regions = json.load(inputUS)
dataset = dict()
for region in regions.keys():
    state = region
    if state not in dataset:
        dataset[state] = dict()
    
    cases = regions[region]
    dataset[region] = cases<jupyter_output><empty_output><jupyter_text>--- Plot a single state<jupyter_code>import ipywidgets as widgets
import pandas as pd
import plotly.express as px
selectionBox = widgets.Dropdown(
        options     = sorted(dataset.keys()),
        description = 'State:',
        disabled    = False,
    )
display(selectionBox)
state = selectionBox.value
stateDataset = dataset[state]
plotDataset = pd.DataFrame([['%s - %d' % (k, stateDataset[k]['confirmed']), stateDataset[k]['confirmed']] for k in sorted(stateDataset.keys(), reverse = True)], columns = ['County', 'Confirmed'])
index       = plotDataset.set_index('County', inplace = True)
plotTitle   = 'Coronavirus in %s - %d confirmed cases' % (state, plotDataset['Confirmed'].sum())<jupyter_output><empty_output><jupyter_text>Plotly version<jupyter_code>chart = px.bar(plotDataset, y = plotDataset.index, x = 'Confirmed', orientation = 'h', title = plotTitle, width = 900, height = 1000)
chart.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14914586070959265, 'fraction_numerical': 0.005913272010512484, 'mean_word_length': 4.835249042145594, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '237420', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 498, 'n_tokens_neox': 497, 'n_words': 117, 'path': 'work/experiments/countyraid.ipynb', 'repo_name': 'dlwhitehurst/COVIDvu', 'size': '1522'}