<jupyter_start><jupyter_text>World Power Consumption in 2014<jupyter_code>import plotly.graph_objs as go 
from plotly.offline import init_notebook_mode,iplot
init_notebook_mode(connected=True) 
# Import the dataset
import pandas as pd
df = pd.read_csv('2014_World_Power_Consumption')
df.head(5)
data = dict(type = 'choropleth',
           colorscale = 'Electric',
           reversescale = True,
           locations = df['Country'],
           locationmode = 'country names',
           z = df['Power Consumption KWH'],
           text = df['Country'],
           colorbar = {'title': '2014 Power Consumption in KWH'})
layout = dict(title = '2014 Power Consumption in KWH',
             geo = dict (showframe = False, projection = {'type': 'natural earth'}))
choromap = go.Figure(data=[data], layout=layout)
iplot(choromap,validate=False)<jupyter_output><empty_output><jupyter_text>China and USA were the major power consuming nations in 2014.   2012 General Election Voting Data<jupyter_code>elect = pd.read_csv('2012_Election_Data')
elect.head()
data = dict(type='choropleth',
            colorscale = 'Viridis',
            reversescale = True,
            locations = elect['State Abv'],
            z = elect['Voting-Age Population (VAP)'],
            locationmode = 'USA-states',
            text = elect['State'],
            marker = dict(line = dict(color = 'rgb(12,12,12)',width = 1)),
            colorbar = {'title':"Voting-Age Population (VAP)"}
            ) 
layout = dict(title = '2012 General Election Voting Data',
              geo = dict(scope='usa',showlakes = True, lakecolor = 'rgb(85,173,240)'))
choromap1 = go.Figure(data = [data],layout = layout)
iplot(choromap1)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12783265543288785, 'fraction_numerical': 0.02905287623474724, 'mean_word_length': 3.359493670886076, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '184648', 'license': 'MIT', 'n_tokens_mistral': 581, 'n_tokens_neox': 525, 'n_words': 127, 'path': 'More Choropleth Maps.ipynb', 'repo_name': 'yanglusi/Visualization', 'size': '1721'}