Difference makes the DIFFERENCE
!pip install nbconvert
!pip install chart_studio
def configure_plotly_browser_state():
import IPython
display(IPython.core.display.HTML('''
<script src="/static/components/requirejs/require.js"></script>
<script>
requirejs.config({
paths: {
base: '/static/base',
plotly: 'https://cdn.plot.ly/plotly-1.5.1.min.js?noext',
},
});
</script>
'''))
import chart_studio.plotly as py
import pandas as pd
import plotly.graph_objs as go
from plotly.offline import download_plotlyjs, init_notebook_mode, iplot, plot
%matplotlib inline
init_notebook_mode(connected = True)
df = pd.read_csv('/content/2014_World_GDP')
df.head(1)
data = dict(type='choropleth',
locations = df['CODE'],
text = df['COUNTRY'],
z = df['GDP (BILLIONS)'],
colorscale = 'YlOrRd')
layout = dict(title = 'World GDP',
geo = dict(showframe = False, projection = {'type':'mercator'}))
choromap = go.Figure(data = [data], layout = layout)
configure_plotly_browser_state()
iplot(choromap)
# ** LAST CELL ** #