<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:  Import pandas and read the csv file
Step2:  Referencing the lecture notes, create a Choropleth Plot of the Power Consumption for Countries using the data and layout dictionary.
Step3:  USA Choropleth
 Import the 2012_Election_Data csv file using pandas.
Step4:  Check the head of the DataFrame.
Step5:  Now create a plot that displays the Voting-Age Population (VAP) per state. If you later want to play around with other columns, make sure you consider their data type. VAP has already been transformed to a float for you.
<ASSISTANT_TASK:>
Python Code:
import plotly.graph_objs as go 
from plotly.offline import init_notebook_mode,iplot
init_notebook_mode(connected=True)
import pandas as pd
Explanation: <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
Choropleth Maps Exercise
Welcome to the Choropleth Maps Exercise! In this exercise we will give you some simple datasets and ask you to create Choropleth Maps from them. Due to the Nature of Plotly we can't show you examples
Full Documentation Reference
Plotly Imports
End of explanation
df = pd.read_csv('./2014_World_Power_Consumption')
df.head()
Explanation: Import pandas and read the csv file: 2014_World_Power_Consumption
End of explanation
data = {'type':'choropleth', 'locations':df['Country'],'locationmode':'country names',
       'z':df['Power Consumption KWH'], 'text':df['Text']}
layout={'title':'World power consumption', 
       'geo':{'showframe':True, 'projection':{'type':'Mercator'}}}
choromap = go.Figure(data = [data],layout = layout)
iplot(choromap,validate=False)
Explanation: Referencing the lecture notes, create a Choropleth Plot of the Power Consumption for Countries using the data and layout dictionary.
End of explanation
df2 = pd.read_csv('./2012_Election_Data')
Explanation: USA Choropleth
 Import the 2012_Election_Data csv file using pandas.
End of explanation
df2.head()
Explanation: Check the head of the DataFrame.
End of explanation
data = {'type':'choropleth', 'locations':df2['State Abv'],'locationmode':'USA-states',
       'z':df2['% Non-citizen'], 'text':df2['% Non-citizen']}
layout={'geo':{'scope':'usa'}}
choromap = go.Figure(data = [data],layout = layout)
iplot(choromap,validate=False)
Explanation: Now create a plot that displays the Voting-Age Population (VAP) per state. If you later want to play around with other columns, make sure you consider their data type. VAP has already been transformed to a float for you.
End of explanation
<END_TASK>