<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 <a href='http
Step1:  Now set up everything so that the figures show up in the notebook
Step2:  More info on other options for Offline Plotly usage can be found here.
Choropleth US Maps
Plotly's mapping can be a bit hard to get used to at first, remember to reference the cheat sheet in the data visualization folder, or find it online here.
Step3:  Now we need to begin to build our data dictionary. Easiest way to do this is to use the dict() function of the general form
Step4:  Then we create the layout nested dictionary
Step5:  Then we use
Step6:  Real Data US Map Choropleth
Now let's show an example with some real data as well as some other options we can add to the dictionaries in data and layout.
Step7:  Now out data dictionary with some extra marker and colorbar arguments
Step8:  And our layout dictionary with some more arguments
Step9:  World Choropleth Map
Now let's see an example with a World Map
<ASSISTANT_TASK:>
Python Code:
import plotly.plotly as py
import plotly.graph_objs as go 
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
Choropleth Maps
Offline Plotly Usage
Get imports and set everything up to be working offline.
End of explanation
init_notebook_mode(connected=True) 
Explanation: Now set up everything so that the figures show up in the notebook:
End of explanation
import pandas as pd
Explanation: More info on other options for Offline Plotly usage can be found here.
Choropleth US Maps
Plotly's mapping can be a bit hard to get used to at first, remember to reference the cheat sheet in the data visualization folder, or find it online here.
End of explanation
data = dict(type = 'choropleth',
            locations = ['AZ','CA','NY'],
            locationmode = 'USA-states',
            colorscale= 'Portland',
            text= ['text1','text2','text3'],
            z=[1.0,2.0,3.0],
            colorbar = {'title':'Colorbar Title'})
Explanation: Now we need to begin to build our data dictionary. Easiest way to do this is to use the dict() function of the general form:
type = 'choropleth',
locations = list of states
locationmode = 'USA-states'
colorscale= 
Either a predefined string:
'pairs' | 'Greys' | 'Greens' | 'Bluered' | 'Hot' | 'Picnic' | 'Portland' | 'Jet' | 'RdBu' | 'Blackbody' | 'Earth' | 'Electric' | 'YIOrRd' | 'YIGnBu'
or create a custom colorscale
text= list or array of text to display per point
z= array of values on z axis (color of state)
colorbar = {'title':'Colorbar Title'})
Here is a simple example:
End of explanation
layout = dict(geo = {'scope':'usa'})
Explanation: Then we create the layout nested dictionary:
End of explanation
choromap = go.Figure(data = [data],layout = layout)
iplot(choromap)
Explanation: Then we use: 
go.Figure(data = [data],layout = layout)
to set up the object that finally gets passed into iplot()
End of explanation
df = pd.read_csv('2011_US_AGRI_Exports')
df.head()
Explanation: Real Data US Map Choropleth
Now let's show an example with some real data as well as some other options we can add to the dictionaries in data and layout.
End of explanation
data = dict(type='choropleth',
            colorscale = 'YIOrRd',
            locations = df['code'],
            z = df['total exports'],
            locationmode = 'USA-states',
            text = df['text'],
            marker = dict(line = dict(color = 'rgb(255,255,255)',width = 2)),
            colorbar = {'title':"Millions USD"}
            ) 
Explanation: Now out data dictionary with some extra marker and colorbar arguments:
End of explanation
layout = dict(title = '2011 US Agriculture Exports by State',
              geo = dict(scope='usa',
                         showlakes = True,
                         lakecolor = 'rgb(85,173,240)')
             )
choromap = go.Figure(data = [data],layout = layout)
iplot(choromap)
Explanation: And our layout dictionary with some more arguments:
End of explanation
df = pd.read_csv('2014_World_GDP')
df.head()
data = dict(
        type = 'choropleth',
        locations = df['CODE'],
        z = df['GDP (BILLIONS)'],
        text = df['COUNTRY'],
        colorbar = {'title' : 'GDP Billions US'},
      ) 
layout = dict(
    title = '2014 Global GDP',
    geo = dict(
        showframe = False,
        projection = {'type':'Mercator'}
    )
)
choromap = go.Figure(data = [data],layout = layout)
iplot(choromap)
Explanation: World Choropleth Map
Now let's see an example with a World Map:
End of explanation
<END_TASK>