<jupyter_start><jupyter_text>Geocode London StationsSource: https://data.london.gov.uk/dataset/london-underground-performance-reports<jupyter_code>import pandas
from cartoframes.auth import set_default_credentials
from cartoframes.data.services import Geocoding

set_default_credentials('johnsmith', '<KEY>')
local_file_path = '../files/london_stations.xls'
df = pandas.read_excel(local_file_path, header=6, sheet_name=1)
df.head()
df = df.rename(columns={
    "Saturday.1": "saturday_exit",
    "Sunday.1": "sunday_exit",
    "Weekday.1": "weekday_exit",
    "Saturday": "saturday_entry",
    "Sunday": "sunday_entry",
    "Weekday": "weekday_entry"
})

df.head()
gc = Geocoding()

london_cdf, london_metadata = gc.geocode(
    df,
    street='Borough',
    city={'value': 'London'},
    country={'value': 'United Kingdom'},
    table_name='london_stations',
    if_exists='replace'
)
london_cdf.head()
from cartoframes import CartoDataFrame

london_stations_cdf = CartoDataFrame.from_carto('london_stations')
london_stations_cdf.head()
from cartoframes.viz import Map, Layer

Map(Layer('london_stations'), viewport={'zoom': 10, 'lat': 51.53, 'lng': -0.09})<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14898989898989898, 'fraction_numerical': 0.011784511784511785, 'mean_word_length': 6.206060606060606, 'pattern_counts': {'":': 6, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 1, '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': '463848', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 457, 'n_tokens_neox': 439, 'n_words': 71, 'path': 'examples/real_use_cases/geocoding_london_stations.ipynb', 'repo_name': 'manmorjim/cartoframes', 'size': '1203'}