<jupyter_start><jupyter_text>Add web layers from item<jupyter_code>from arcgis.gis import *
item = gis.content.get('2158ce05955d4c529636b9fa0943193f')
usa_map.add_layer(item, {"renderer" : "ClassedColorRenderer",
                         "field_name" : "TOTPOP10",
                         "opacity": 0.7})
item<jupyter_output><empty_output><jupyter_text>Add Layer from CSV<jupyter_code>import pandas as pd
df = pd.read_csv('data/chennai-rainfall.csv')
df.head()
# Create an arcgis.features.FeatureCollection object by importing the pandas dataframe with an address field
rainfall = gis.content.import_data(df, {"Address" : "LOCATION"})
rainfall
tamil_map = gis.map("Tamil Nadu", zoomlevel=7)
tamil_map.add_layer(rainfall, { "renderer":"ClassedSizeRenderer",
                                 "field_name":"RAINFALL" })

tamil_map<jupyter_output><empty_output><jupyter_text>Save map<jupyter_code>item_properties={'title':'Rainfall in Tamil',
                    'snippet': 'Jupyter notebook widget saved as a web map',
                    'tags':['automation', 'python']}
webmap_item = tamil_map.save(item_properties)
webmap_item<jupyter_output><empty_output><jupyter_text>Basemaps<jupyter_code>from arcgis.gis import GIS
map4 = gis.map('New York City, NY')
map4
import time

for basemap in map4.basemaps:
    map4.basemap = basemap
    print(basemap)
    time.sleep(3)<jupyter_output>dark-gray
dark-gray-vector
gray
gray-vector
hybrid
national-geographic
oceans
osm
satellite
streets
streets-navigation-vector
streets-night-vector<jupyter_text>Asyncronous Widget Behavior<jupyter_code>map = gis.map('San Diego convention center, San Diego, CA', 16)
map
def find_addr(map, g):
    try:
        map.draw(g)
        geocoded = geocoding.reverse_geocode(g)
        print(geocoded['address']['Match_addr'])
    except Exception as e:
        print("Couldn't match address. Try another place...")
        print(e)
map.on_click(find_addr)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11473737888832228, 'fraction_numerical': 0.018357980622131564, 'mean_word_length': 4.302702702702702, 'pattern_counts': {'":': 3, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '655283', 'license': 'Apache-2.0', 'n_tokens_mistral': 725, 'n_tokens_neox': 684, 'n_words': 130, 'path': 'talks/uc2019/Deep Dive into Python API/widget-1.ipynb', 'repo_name': 'test-v1/arcgis-python-api', 'size': '1961'}