<jupyter_start><jupyter_text>Sugar  Sugar and Education  Data Cleaning  CDC 2013 SourceTABLE 3. Crude prevalence* of sugar-sweetened beverage† consumption ≥1 time/day among adults, by employment status, education, and state — Behavioral Risk Factor Surveillance System, 23 states and District of Columbia, 2013https://www.cdc.gov/mmwr/volumes/65/wr/mm6507a1.htm<jupyter_code>import pandas as pd

cdc_2013 = pd.read_csv("https://raw.githubusercontent.com/noahgift/sugar/master/data/education_sugar_cdc_2003.csv")
cdc_2013.set_index("State", inplace=True)
cdc_2013.head()
for column in cdc_2013.columns:
  cdc_2013[column]=cdc_2013[column].str.replace(r"\(.*\)","")
  cdc_2013[column]=pd.to_numeric(cdc_2013[column])
  
cdc_2013.reset_index(inplace=True) 
cdc_2013.head()
  
cdc_2013.describe()<jupyter_output><empty_output><jupyter_text>Education and Sugar<jupyter_code>!wget https://raw.githubusercontent.com/python-visualization/folium/master/examples/data/us-states.json
!ls -l<jupyter_output>--2019-03-20 23:57:49--  https://raw.githubusercontent.com/python-visualization/folium/master/examples/data/us-states.json
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 172.16.31.10, 172.16.58.3, 172.16.31.10, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|172.16.31.10|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 87688 (86K) [text/plain]
Saving to: ‘us-states.json.2’


us-states.json.2      0%[                    ]       0  --.-KB/s               
us-states.json.2    100%[===================>]  85.63K  --.-KB/s    in 0.02s   

2019-03-20 23:57:50 (3.39 MB/s) - ‘us-states.json.2’ saved [87688/87688]

total 280
drwxr-xr-x 1 root root  4096 Mar  8 17:26 sample_data
-rw-r--r-- 1 root root 87688 Mar 20 22:43 us-states.json
-rw-r--r-- 1 root root 87688 Mar 20 22:43 us-states.json.1
-rw-r--r-- 1 root root 87688 Mar 20 23:57 us-states.json.2<jupyter_text>Low Education == High Sugar<jupyter_code>import folium
m = folium.Map(location=[36, -102], zoom_start=3)

folium.Choropleth(
    geo_data="us-states.json",
    name='choropleth',
    data=cdc_2013,
    columns=['State', '<High school'],
    key_on='feature.properties.name',
    fill_color='OrRd',
    fill_opacity=0.7,
    line_opacity=0.2,
    legend_name='<High school Education and Grams Sugar Intake Daily'
).add_to(m)

folium.LayerControl().add_to(m)

m<jupyter_output><empty_output><jupyter_text>College Education Major Decrease in Sugar Intake<jupyter_code>import folium
m = folium.Map(location=[36, -102], zoom_start=3)

folium.Choropleth(
    geo_data="us-states.json",
    name='choropleth',
    data=cdc_2003,
    columns=['State', 'College graduate'],
    key_on='feature.properties.name',
    fill_color='OrRd',
    fill_opacity=0.7,
    line_opacity=0.2,
    legend_name='College graduate and Grams Sugar Intake Daily'
).add_to(m)

folium.LayerControl().add_to(m)

m<jupyter_output><empty_output><jupyter_text>Median Daily Sugar Intake by Category<jupyter_code>cdc_2003.columns<jupyter_output><empty_output><jupyter_text>College Graduate<jupyter_code>cdc_2003["College graduate"].median()
cdc_2003["<High school"].median()
cdc_2003[["State","College graduate", "<High school"]].plot.barh(
    stacked=True, figsize=(12, 12)).set_title("CDC 2013: Three Times Higher Sugar Intake College vs High School Grads")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14813719692489652, 'fraction_numerical': 0.08131283264340627, 'mean_word_length': 4.7241962774957695, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 25, 'https://': 4, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 4, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '104294', 'license': 'MIT', 'n_tokens_mistral': 1469, 'n_tokens_neox': 1249, 'n_words': 232, 'path': 'content/topics/sugar.ipynb', 'repo_name': 'noahgift/sugar', 'size': '3390'}