<jupyter_start><jupyter_text>There are two 'classes' that we see of care-providers- `categories`, which are more coarse grained - `types` which are more fine-grained.<jupyter_code>url = "https://health.axa.ch/hack/api/care-providers/categories"

r = requests.get(url, headers={'Authorization' : 'cut canvas'})
tab = json.loads(r.text)
cat_df = pd.DataFrame(tab['result'])

cat_df.head()
##types (finer way of representing categories)

url2 = "https://health.axa.ch/hack/api/care-providers/types"
r2 = requests.get(url2, headers={'Authorization' : 'cut canvas'})
tab2 = json.loads(r2.text)
types_df = pd.DataFrame(tab2['result'])

types_df.head()<jupyter_output><empty_output><jupyter_text>Finding the list of all physician types<jupyter_code>##url_q queries url for all physicians

types_physicians = cat_df[cat_df['en']=='physicians']['types']

types_physicians.iloc[0][0]

url_q = 'https://health.axa.ch/hack/api/care-providers?type='
for link in types_physicians.iloc[0]:
    url_q = url_q + str(link) + '&type='

url_q = url_q[:-6] #remove last &type=

r_q = requests.get(url_q, headers={'Authorization' : 'cut canvas'})
tab_q = json.loads(r_q.text)
# print(tab_q)
phys_dict = {}

for link in types_physicians.iloc[0]:
    phys_dict[link] = types_df[types_df['_id']==link]['en'].iloc[0]
    
# phys_dict
##url_q queries url for all physicians in the city of Zurich

r_q = requests.get(url_q + '&city=zurich', headers={'Authorization' : 'cut canvas'})
tab_q = json.loads(r_q.text)

# print(tab_q)
##url_q queries for physicians in the city of Zurich, top 10 closest ones to a selected location (47.37,8.49)

r_q = requests.get(url_q + '&nearLat=47.37&nearLng=8.49&nearLimit=10', headers={'Authorization' : 'cut canvas'})
tab_q = json.loads(r_q.text)

# print(tab_q)
##url_q queries for physicians in the city of Zurich, top 10 closest ones to a selected location (47.37,8.49)

##ERROR in distance

r_q = requests.get(url_q + '&nearLat=47.37&nearLng=8.49&nearDistance=1000', headers={'Authorization' : 'cut canvas'})
tab_q = json.loads(r_q.text)

# print(tab_q)<jupyter_output><empty_output><jupyter_text>The same analysis for pharmacies<jupyter_code>##url_q queries url for all pharmacies

types_pharmas = cat_df[cat_df['en']=='pharmacies']['types']

types_pharmas.iloc[0][0]

url_q = 'https://health.axa.ch/hack/api/care-providers?type='
for link in types_physicians.iloc[0]:
    url_q = url_q + str(link) + '&type='

url_q = url_q[:-6] #remove last &type=

r_q = requests.get(url_q, headers={'Authorization' : 'cut canvas'})
tab_q = json.loads(r_q.text)

# print(tab_q)
pharma_dict = {}

for link in types_pharmas.iloc[0]:
    pharma_dict[link] = types_df[types_df['_id']==link]['en'].iloc[0]

pharma_dict<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16167883211678832, 'fraction_numerical': 0.020437956204379562, 'mean_word_length': 5.939240506329114, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 4, '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': '558899', 'license': 'MIT', 'n_tokens_mistral': 1098, 'n_tokens_neox': 1076, 'n_words': 214, 'path': 'Data Exploration.ipynb', 'repo_name': 'venkytheironman/SMA', 'size': '2740'}