<jupyter_start><jupyter_text>Local maps Local maps are designed to support ongoing iterative data analysis. You can add data and layers to a local map. Neither the map itself nor any data you add to it is uploaded to the Unfolded cloud. Note that you still need to use a valid Unfolded token to create local maps. To create a local map you just need to instantiate an `UnfoldedMap` object:<jupyter_code>from unfolded.map_sdk import UnfoldedMap
unfolded_map = UnfoldedMap()<jupyter_output><empty_output><jupyter_text>Now we can display the empty map:<jupyter_code>from sidecar import Sidecar
sc = Sidecar(title='Unfolded map demo', anchor='split-right')
with sc:
    display(unfolded_map)<jupyter_output><empty_output><jupyter_text>Adding datasets We can add a dataframe as a dataset to the map. To do this we first create a unique identifier for the dataset, so that we can refer to it later:<jupyter_code>from uuid import uuid4
dataset_id=uuid4()<jupyter_output><empty_output><jupyter_text>Dataframe Now let's add load a CSV into a dataframe and add it as a dataset to the map:<jupyter_code>import pandas as pd
unfolded_map.add_dataset({
    'uuid': dataset_id,
    'label': 'Earthquakes dataset',
    'data': pd.read_csv('data/earthquakes.csv')
})<jupyter_output><empty_output><jupyter_text>To remove the dataset you can call passing its `id`:<jupyter_code>unfolded_map.remove_dataset(dataset_id)<jupyter_output><empty_output><jupyter_text>GeoJSON The `add_dataset` method also supports GeoJSON:<jupyter_code>with open('data/nyc-census.json', 'r') as f:
    census_tracts_geojson = f.read()
unfolded_map.add_dataset({'data': census_tracts_geojson})<jupyter_output><empty_output><jupyter_text>CSV Or CSV passed as a string:<jupyter_code>with open('data/earthquakes.csv', 'r') as f:
    earthquakes = f.read()
unfolded_map.add_dataset({'data': earthquakes})<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09114997350291468, 'fraction_numerical': 0.0010598834128245894, 'mean_word_length': 6.83402489626556, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '142952', 'license': 'MIT', 'n_tokens_mistral': 643, 'n_tokens_neox': 628, 'n_words': 192, 'path': 'notebooks/02 - Local maps.ipynb', 'repo_name': 'kuwala-io/examples', 'size': '1887'}