<jupyter_start><jupyter_text>async def myCoroutine():    for x in range(len(sc_df)):        geocode_result = gmaps.geocode(sc_df['Full Address'][x])         await asyncio.sleep(1)        sc_df['Latitude'][x] = geocode_result[0]['geometry']['location'] ['lat']         await asyncio.sleep(1)        sc_df['Longitude'][x] = geocode_result[0]['geometry']['location']['lng']         await asyncio.sleep(1) if __name__ == '__main__':    loop = asyncio.get_event_loop()     tasks = (myCoroutine(x) for x in enumerate(sc_addresses))    loop.run_until_complete(myCoroutine())asyncio.run(myCoroutine()) sc_df nc_df['Latitude'] = ""nc_df['Longitude'] = ""nc_lat = []nc_lng = []nc_addresses = nc_df['Full Address'].tolist() async def myCoroutine():    for x in range(len(nc_df)):        geocode_result = gmaps.geocode(nc_df['Full Address'][x])         await asyncio.sleep(1)        nc_df['Latitude'][x] = geocode_result[0]['geometry']['location'] ['lat']         await asyncio.sleep(1)        nc_df['Longitude'][x] = geocode_result[0]['geometry']['location']['lng']         await asyncio.sleep(1) if __name__ == '__main__':    loop = asyncio.get_event_loop()     tasks = (myCoroutine(x) for x in enumerate(nc_addresses))    loop.run_until_complete(myCoroutine())asyncio.run(myCoroutine()) nc_df sc_df.to_csv('south_carolina.csv', index=False, header=True) for x in range(len(nc_df)):    try:        time.sleep(1) to add delay in case of large DFs        geocode_result = gmaps.geocode(nc_df['Full Address'][x])        nc_df['Latitude'][x] = geocode_result[0]['geometry']['location'] ['lat']        nc_df['Longitude'][x] = geocode_result[0]['geometry']['location']['lng']    except:        print('Nope') import geopyfrom geopy import GoogleV3geolocator = GoogleV3(api_key='<KEY>') nc_df["loc"] = nc_df["Full Address"].apply(geolocator.geocode) nc_df["point"]= nc_df["loc"].apply(lambda loc: tuple(loc.point) if loc else None) nc_df[['Latitude', 'Longitude', 'Altitude']] = pd.DataFrame(nc_df['point'].to_list(), index=nc_df.index) nc_df = nc_df.drop(columns=['loc', 'point', 'Altitude']) nc_df locations = sc_df[["Latitude", "Longitude"]].astype(float)locations_2 = nc_df[["Latitude", "Longitude"]].astype(float) sc_df["loc"] = sc_df["Full Address"].apply(geolocator.geocode)sc_df["point"]= sc_df["loc"].apply(lambda loc: tuple(loc.point) if loc else None)sc_df[['Latitude', 'Longitude', 'Altitude']] = pd.DataFrame(sc_df['point'].to_list(), index=sc_df.index) sc_df = sc_df.drop(columns=['loc', 'point', 'Altitude']) sc_df<jupyter_code>nc_df = pd.read_csv('north_carolina.csv', names=['First Name', 'Last Name', 'Address', 'City', 'State', 'Zip', 'License Code', 'License Number', 'Expiration Date', 'License Status Code', 'Full Address', 'Latitude', 'Longitude'])
sc_df = pd.read_csv('south_carolina.csv', names=['First Name', 'Last Name', 'Address', 'City', 'State', 'Zip', 'License Code', 'License Number', 'Expiration Date', 'License Status Code', 'Full Address', 'Latitude', 'Longitude'])
sc_df.to_csv('south_carolina.csv', index=False, header=True)
nc_df.to_csv('north_carolina.csv', index=False, header=True)
nc_df
sc_df
locations = sc_df[["Latitude", "Longitude"]].astype(float)
locations_2 = nc_df[["Latitude", "Longitude"]].astype(float)
import gmaps
gmaps.configure(api_key='<KEY>')
fig = gmaps.figure()

fig.add_layer(gmaps.heatmap_layer(locations))

fig
nc_df = nc_df.dropna()
nc_df
nc_df['City'] = nc_df['City'].str.title()
sc_df['City'] = sc_df['City'].str.title()
nc_df['Address'] = nc_df['Address'].str.title()
sc_df['Address'] = sc_df['Address'].str.title()
nc_df['Full Address'] = nc_df['Full Address'].str.title()
sc_df['Full Address'] = sc_df['Full Address'].str.title()
nc_df
nc_df = pd.read_csv('north_carolina.csv', names=['First Name', '<NAME>', 'Address', 'City', 'State', 'Zip', 'License Code', 'License Number', 'Expiration Date', 'License Status Code', 'Full Address', 'Latitude', 'Longitude'])
sc_df = pd.read_csv('south_carolina.csv', names=['First Name', '<NAME>', 'Address', 'City', 'State', 'Zip', 'License Code', 'License Number', 'Expiration Date', 'License Status Code', 'Full Address', 'Latitude', 'Longitude'])
nc_df['City'] = nc_df['City'].str.title()
sc_df['City'] = sc_df['City'].str.title()
nc_df['Address'] = nc_df['Address'].str.title()
sc_df['Address'] = sc_df['Address'].str.title()
nc_df['Full Address'] = nc_df['Full Address'].str.title()
sc_df['Full Address'] = sc_df['Full Address'].str.title()
nc_df.to_csv('north_carolina.csv', index=False, header=True)
sc_df.to_csv('south_carolina.csv', index=False, header=True)
new_df = pd.read_csv('south_carolina.csv')
new_df
charlotte_df = nc_df.loc[nc_df['City'] == 'Charlotte']
charlotte_df = charlotte_df.reset_index()
charlotte_df = charlotte_df.drop(columns=['index'])
charlotte_df.to_csv('charlotte.csv', index=False, header=True)
nc_df['City'].value_counts().head(50)
charlotte_df
huntersville_df = nc_df.loc[nc_df['City'] == 'Huntersville']
huntersville_df = huntersville_df.reset_index()
huntersville_df = huntersville_df.drop(columns=['index'])
huntersville_df.to_csv('huntersville.csv', index=False, header=True)
concord_df = nc_df.loc[nc_df['City'] == 'Concord']
concord_df = concord_df.reset_index()
concord_df = concord_df.drop(columns=['index'])
concord_df.to_csv('concord.csv', index=False, header=True)
gastonia_df = nc_df.loc[nc_df['City'] == 'Gastonia']
gastonia_df = gastonia_df.reset_index()
gastonia_df = gastonia_df.drop(columns=['index'])
gastonia_df.to_csv('gastonia.csv', index=False, header=True)
matthews_df = nc_df.loc[nc_df['City'] == 'Matthews']
matthews_df = matthews_df.reset_index()
matthews_df = matthews_df.drop(columns=['index'])
matthews_df.to_csv('matthews.csv', index=False, header=True)
kannapolis_df = nc_df.loc[nc_df['City'] == 'Kannapolis']
kannapolis_df = kannapolis_df.reset_index()
kannapolis_df = kannapolis_df.drop(columns=['index'])
kannapolis_df.to_csv('kannapolis.csv', index=False, header=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19281758684343012, 'fraction_numerical': 0.0031884544386642055, 'mean_word_length': 7.26629680998613, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '460135', 'license': 'MIT', 'n_tokens_mistral': 2247, 'n_tokens_neox': 2221, 'n_words': 370, 'path': 'data/Data Notebook.ipynb', 'repo_name': 'jimmywhite1987/Cosmetologists', 'size': '6033'}