Last active
July 6, 2019 07:07
-
-
Save sskanishk/badbf24b1b3086cf70f0cd60020ca4b6 to your computer and use it in GitHub Desktop.
Tables and plots are the most common outputs when doing data analysis, but Jupyter notebooks can render many more types of outputs such as sound, animation, video, etc. Yes, almost anything that can be shown in a modern web browser. This also makes it possible to include interactive widgets directly in the notebook! For example, this (slightly c…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Making a map using the folium module | |
import folium | |
phone_map = folium.Map() | |
# Top three smart phone companies by market share in 2016 | |
companies = [ | |
{'loc': [37.4970, 127.0266], 'label': 'Samsung: 20.5%'}, | |
{'loc': [37.3318, -122.0311], 'label': 'Apple: 14.4%'}, | |
{'loc': [22.5431, 114.0579], 'label': 'Huawei: 8.9%'}] | |
# Adding markers to the map | |
for company in companies: | |
marker = folium.Marker(location=company['loc'], popup=company['label']) | |
marker.add_to(phone_map) | |
# The last object in the cell always gets shown in the notebook | |
phone_map |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment