<jupyter_start><jupyter_text><jupyter_code>import pandas as pd
import requests<jupyter_output><empty_output><jupyter_text>data source: https://data.cms.gov/cms-innovation-center-programs/strong-start-for-mothers-and-newborns-initiative/strong-start-awardeesThe Strong Start Awardees dataset provides information on the financial awards made to participants in the Strong Start for Mothers and Newborns Initiative. This initiative tested three evidence-based maternity care service approaches with the goal of improving health outcomes of pregnant women and newborns. The data can include the participant name, participant location, locations of practices participating under the participants’ umbrella practice, descriptive text for the type(s) of enhanced prenatal care provided, and the amount of funding awarded to the participant as a result of their participation in year 1 of the initiative.<jupyter_code>response = requests.get('https://data.cms.gov/data-api/v1/dataset/647e8a75-2135-49a0-83a8-f3b12f687d18/data')

if response.ok:
  payload = response.json()
else:
  print(f'Request unsuccessful: {response.status_code}')
  payload = None
df = pd.DataFrame(payload)
df.head()
df.columns = df.columns.str.replace(' ','_')
df.rename(columns={'Location_of_the_Enhanced_Prenatal_Care_Services':'Location','Award_Amount_(Year_1)_':'Award_Amount', 'Enhanced_Prenatal_Care_Approaches':'Approaches'}, inplace=True)
df.columns
df.head()
df[['State','GPS']] = df['Awardee_State'].str.split(' \(', expand=True)
# need to split this column
#df[['A', 'B']] = df['AB'].str.split(' ', 1, expand=True)

df.State[0]
df.GPS[0]
df[['Latitude','Longitude']] = df['GPS'].str.split(',', expand=True)
df.Longitude = df.Longitude.str.replace(')','')
df.Longitude[0]
df.drop(['Awardee_State','GPS'], axis=1, inplace=True)
df.head()
df.Approaches.value_counts()
df.Award_Amount = df.Award_Amount.astype(int)
df.Award_Amount.plot(kind='kde')
# this was right the whole time, I just didn't realize the scale of the numbers was millions 
df.Award_Amount.plot(kind='hist', bins=20)
import matplotlib.pyplot as plt 
import seaborn as sns 
%matplotlib inline
sns.displot(data = df, x='Award_Amount')
df.Award_Amount.value_counts()
sns.histplot(data=df, x='Award_Amount', bins=10)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13134851138353765, 'fraction_numerical': 0.01576182136602452, 'mean_word_length': 6.825342465753424, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '264914', 'license': 'MIT', 'n_tokens_mistral': 789, 'n_tokens_neox': 747, 'n_words': 186, 'path': 'CMS_API_StrongStart.ipynb', 'repo_name': 'dansarmiento/ColaboratoryRunningAnalysis', 'size': '2284'}