Skip to content

Instantly share code, notes, and snippets.

@sskanishk
Last active July 6, 2019 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sskanishk/badbf24b1b3086cf70f0cd60020ca4b6 to your computer and use it in GitHub Desktop.
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…
Display the source blob
Display the rendered blob
Raw
# 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