From 35082283a38e74bf3969ec0777ac2c676d89aee1 Mon Sep 17 00:00:00 2001 From: Mashrin Srivastava Date: Mon, 23 Oct 2017 01:07:01 +0530 Subject: [PATCH 1/2] Part of checkpoint directory --- ...ediction and co2 emission-checkpoint.ipynb | 12816 ---------------- 1 file changed, 12816 deletions(-) delete mode 100644 Fuel_prediction/.ipynb_checkpoints/Fuel prediction and co2 emission-checkpoint.ipynb diff --git a/Fuel_prediction/.ipynb_checkpoints/Fuel prediction and co2 emission-checkpoint.ipynb b/Fuel_prediction/.ipynb_checkpoints/Fuel prediction and co2 emission-checkpoint.ipynb deleted file mode 100644 index 3ba4038..0000000 --- a/Fuel_prediction/.ipynb_checkpoints/Fuel prediction and co2 emission-checkpoint.ipynb +++ /dev/null @@ -1,12816 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### GOAL: \n", - "1. Get the Shortest Distance between two places\n", - "2. Get the fuel estimation for the journey\n", - "3. How much CO2 have you saved from being emitted?\n", - "4. Get the estimated time required to travel based on the recharge time\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Understanding the dataset for electric cars\n", - "Transmission: A = Automatic AV = Continuously variable\n", - "\n", - "Fuel Type: B = Electricity X = Regular gasoline Z = Premium gasoline (since this is a dataset of Electric vehicles all are B)\n", - "\n", - "Consumption: The combined fuel consumption rating reflects 55 percent city and 45 percent highway driving. 2 Le is gasoline litre equivalent. One litre of gasoline contains the energy equivalent to 8.9 kWh of electricity. \n", - "\n", - "CO2 Emissions: the tailpipe emissions of carbon dioxide (in grams per kilometre) for combined city and highway driving. \n", - "\n", - "CO2 Rating: the tailpipe emissions of carbon dioxide rated on a scale from 1 (worst) to 10 (best). \n", - "\n", - "Smog Rating: the tailpipe emissions of smog-forming pollutants rated on a scale from 1 (worst) to 10 (best). \n", - "\n", - "Range: the estimated driving distance (in kilometres) on a fully charged battery or full tank of fuel. \n", - "\n", - "Recharge time: the estimated time (in hours) to fully recharge the battery at 240 volts\n" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "#importing the necessacary packages in python\n", - "import matplotlib.pyplot as plt\n", - "import pandas as pd\n", - "import pylab as pl\n", - "import numpy as np\n", - "import statsmodels.formula.api as smf\n", - "%matplotlib inline" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
MODELMAKEMODEL.1VEHICLE CLASSMOTORTRANSMISSIONFUELCONSUMPTIONUnnamed: 8Unnamed: 9Unnamed: 10Unnamed: 11Unnamed: 12CO2 EMISSIONSCO2SMOGRANGERECHARGE
0YEARNaNNaNNaN(kW)NaNTYPECITY (kWh/100 km)HWY (kWh/100 km)COMB (kWh/100 km)CITY (Le/100 km)HWY (Le/100 km)COMB (Le/100 km)(g/km)RATINGRATING(km)TIME (h)
12012MITSUBISHIi-MiEVSUBCOMPACT49A1B16.921.418.71.92.42.10n/an/a1007
22012NISSANLEAFMID-SIZE80A1B19.32321.12.22.62.40n/an/a1177
32013FORDFOCUS ELECTRICCOMPACT107A1B1921.1202.12.42.20n/an/a1224
42013MITSUBISHIi-MiEVSUBCOMPACT49A1B16.921.418.71.92.42.10n/an/a1007
\n", - "
" - ], - "text/plain": [ - " MODEL MAKE MODEL.1 VEHICLE CLASS MOTOR TRANSMISSION FUEL \\\n", - "0 YEAR NaN NaN NaN (kW) NaN TYPE \n", - "1 2012 MITSUBISHI i-MiEV SUBCOMPACT 49 A1 B \n", - "2 2012 NISSAN LEAF MID-SIZE 80 A1 B \n", - "3 2013 FORD FOCUS ELECTRIC COMPACT 107 A1 B \n", - "4 2013 MITSUBISHI i-MiEV SUBCOMPACT 49 A1 B \n", - "\n", - " CONSUMPTION Unnamed: 8 Unnamed: 9 Unnamed: 10 \\\n", - "0 CITY (kWh/100 km) HWY (kWh/100 km) COMB (kWh/100 km) CITY (Le/100 km) \n", - "1 16.9 21.4 18.7 1.9 \n", - "2 19.3 23 21.1 2.2 \n", - "3 19 21.1 20 2.1 \n", - "4 16.9 21.4 18.7 1.9 \n", - "\n", - " Unnamed: 11 Unnamed: 12 CO2 EMISSIONS CO2 SMOG RANGE \\\n", - "0 HWY (Le/100 km) COMB (Le/100 km) (g/km) RATING RATING (km) \n", - "1 2.4 2.1 0 n/a n/a 100 \n", - "2 2.6 2.4 0 n/a n/a 117 \n", - "3 2.4 2.2 0 n/a n/a 122 \n", - "4 2.4 2.1 0 n/a n/a 100 \n", - "\n", - " RECHARGE \n", - "0 TIME (h) \n", - "1 7 \n", - "2 7 \n", - "3 4 \n", - "4 7 " - ] - }, - "execution_count": 2, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "elec = pd.read_csv(\"fuel consumption dataset\\MY2012-2017 Battery Electric Vehicles.csv\")\n", - "elec.head() #display the column names and sample data" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
MODELMAKEMODEL.1VEHICLE CLASSFUELCONSUMPTIONUnnamed: 8Unnamed: 9Unnamed: 10Unnamed: 11Unnamed: 12CO2 EMISSIONSCO2SMOGRANGERECHARGE
0YEARNaNNaNNaNTYPECITY (kWh/100 km)HWY (kWh/100 km)COMB (kWh/100 km)CITY (Le/100 km)HWY (Le/100 km)COMB (Le/100 km)(g/km)RATINGRATING(km)TIME (h)
12012MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
22012NISSANLEAFMID-SIZEB19.32321.12.22.62.40n/an/a1177
32013FORDFOCUS ELECTRICCOMPACTB1921.1202.12.42.20n/an/a1224
42013MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
52013NISSANLEAFMID-SIZEB19.32321.12.22.62.40n/an/a1177
62013SMARTFORTWO ELECTRIC DRIVE CABRIOLETTWO-SEATERB17.222.519.61.92.52.20n/an/a1098
72013SMARTFORTWO ELECTRIC DRIVE COUPETWO-SEATERB17.222.519.61.92.52.20n/an/a1098
82013TESLAMODEL S (40 kWh battery)FULL-SIZEB22.421.922.22.52.52.50n/an/a2246
92013TESLAMODEL S (60 kWh battery)FULL-SIZEB22.221.721.92.52.42.50n/an/a33510
102013TESLAMODEL S (85 kWh battery)FULL-SIZEB23.823.223.62.72.62.60n/an/a42612
112013TESLAMODEL S PERFORMANCEFULL-SIZEB23.923.223.62.72.62.60n/an/a42612
122014CHEVROLETSPARK EVSUBCOMPACTB1619.617.81.82.220n/an/a1317
132014FORDFOCUS ELECTRICCOMPACTB1921.1202.12.42.20n/an/a1224
142014MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
152014NISSANLEAFMID-SIZEB16.520.818.41.92.32.10n/an/a1355
162014SMARTFORTWO ELECTRIC DRIVE CABRIOLETTWO-SEATERB17.222.519.61.92.52.20n/an/a1098
172014SMARTFORTWO ELECTRIC DRIVE COUPETWO-SEATERB17.222.519.61.92.52.20n/an/a1098
182014TESLAMODEL S (60 kWh battery)FULL-SIZEB22.221.721.92.52.42.50n/an/a33510
192014TESLAMODEL S (85 kWh battery)FULL-SIZEB23.823.223.62.72.62.60n/an/a42612
202014TESLAMODEL S PERFORMANCEFULL-SIZEB23.923.223.62.72.62.60n/an/a42612
212015BMWi3SUBCOMPACTB15.218.816.81.72.11.90n/an/a1304
222015CHEVROLETSPARK EVSUBCOMPACTB1619.617.81.82.220n/an/a1317
232015FORDFOCUS ELECTRICCOMPACTB1921.1202.12.42.20n/an/a1224
242015KIASOUL EVSTATION WAGON - SMALLB17.522.719.922.62.20n/an/a1494
252015MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
262015NISSANLEAFMID-SIZEB16.520.818.41.92.32.10n/an/a1355
272015SMARTFORTWO ELECTRIC DRIVE CABRIOLETTWO-SEATERB17.222.519.61.92.52.20n/an/a1098
282015SMARTFORTWO ELECTRIC DRIVE COUPETWO-SEATERB17.222.519.61.92.52.20n/an/a1098
292015TESLAMODEL S (60 kWh battery)FULL-SIZEB22.221.721.92.52.42.50n/an/a33510
...................................................
542016TESLAMODEL S P85D/P90DFULL-SIZEB23.421.522.52.62.42.5010n/a40712
552016TESLAMODEL S P90D (Refresh)FULL-SIZEB22.92122.12.62.42.5010n/a43512
562016TESLAMODEL S P100DFULL-SIZEB22.62021.52.52.32.4010n/a50712
572016TESLAMODEL X 60DSUV - STANDARDB2322.222.62.62.52.5010n/a32210
582016TESLAMODEL X 75DSUV - STANDARDB2321.922.52.62.52.5010n/a38312
592016TESLAMODEL X 90DSUV - STANDARDB23.222.222.72.62.52.6010n/a41412
602016TESLAMODEL X P90DSUV - STANDARDB23.623.323.52.72.62.6010n/a40212
612016TESLAMODEL X P100DSUV - STANDARDB25.722.924.42.92.62.7010n/a46512
622017BMWi3 (60 Ah)SUBCOMPACTB15.218.816.81.72.11.9010101304
632017BMWi3 (94 Ah)SUBCOMPACTB16.219.717.81.82.22010101835
642017CHEVROLETBOLT EVSTATION WAGON - SMALLB16.41917.61.82.12010103839.3
652017FORDFOCUS ELECTRICCOMPACTB17.721.819.622.52.2010101855.5
662017KIASOUL EVSTATION WAGON - SMALLB17.42319.922.62.2010101504
672017MITSUBISHIi-MiEVSUBCOMPACTB16.920.518.71.92.32.1010101007
682017NISSANLEAFMID-SIZEB1720.718.61.92.32.1010101726
692017TESLAMODEL S (60 kWh battery)FULL-SIZEB21.520.721.12.42.32.40101033810
702017TESLAMODEL S (75 kWh battery)FULL-SIZEB21.52121.32.42.42.40101040112
712017TESLAMODEL S 60DFULL-SIZEB20.619.620.22.32.22.30101035110
722017TESLAMODEL S 75DFULL-SIZEB20.619.920.32.32.22.30101041712
732017TESLAMODEL S 90DFULL-SIZEB20.619.720.22.32.22.30101047312
742017TESLAMODEL S 100DFULL-SIZEB20.720.520.62.32.32.30101053912
752017TESLAMODEL S P90DFULL-SIZEB22.820.9222.62.32.50101043512
762017TESLAMODEL S P100DFULL-SIZEB22.62021.52.52.32.40101050712
772017TESLAMODEL X 60DSUV - STANDARDB2322.222.62.62.52.50101032210
782017TESLAMODEL X 75DSUV - STANDARDB2321.922.52.62.52.50101038312
792017TESLAMODEL X 90DSUV - STANDARDB23.222.222.72.62.52.60101041412
802017TESLAMODEL X 100DSUV - STANDARDB24.323.7242.72.72.70101047512
812017TESLAMODEL X P90DSUV - STANDARDB23.623.323.52.72.62.60101040212
822017TESLAMODEL X P100DSUV - STANDARDB25.722.924.42.92.62.70101046512
832017VOLKSWAGENe-GOLFCOMPACTB16.818.617.41.92.12010102015.3
\n", - "

84 rows × 16 columns

\n", - "
" - ], - "text/plain": [ - " MODEL MAKE MODEL.1 VEHICLE CLASS \\\n", - "0 YEAR NaN NaN NaN \n", - "1 2012 MITSUBISHI i-MiEV SUBCOMPACT \n", - "2 2012 NISSAN LEAF MID-SIZE \n", - "3 2013 FORD FOCUS ELECTRIC COMPACT \n", - "4 2013 MITSUBISHI i-MiEV SUBCOMPACT \n", - "5 2013 NISSAN LEAF MID-SIZE \n", - "6 2013 SMART FORTWO ELECTRIC DRIVE CABRIOLET TWO-SEATER \n", - "7 2013 SMART FORTWO ELECTRIC DRIVE COUPE TWO-SEATER \n", - "8 2013 TESLA MODEL S (40 kWh battery) FULL-SIZE \n", - "9 2013 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "10 2013 TESLA MODEL S (85 kWh battery) FULL-SIZE \n", - "11 2013 TESLA MODEL S PERFORMANCE FULL-SIZE \n", - "12 2014 CHEVROLET SPARK EV SUBCOMPACT \n", - "13 2014 FORD FOCUS ELECTRIC COMPACT \n", - "14 2014 MITSUBISHI i-MiEV SUBCOMPACT \n", - "15 2014 NISSAN LEAF MID-SIZE \n", - "16 2014 SMART FORTWO ELECTRIC DRIVE CABRIOLET TWO-SEATER \n", - "17 2014 SMART FORTWO ELECTRIC DRIVE COUPE TWO-SEATER \n", - "18 2014 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "19 2014 TESLA MODEL S (85 kWh battery) FULL-SIZE \n", - "20 2014 TESLA MODEL S PERFORMANCE FULL-SIZE \n", - "21 2015 BMW i3 SUBCOMPACT \n", - "22 2015 CHEVROLET SPARK EV SUBCOMPACT \n", - "23 2015 FORD FOCUS ELECTRIC COMPACT \n", - "24 2015 KIA SOUL EV STATION WAGON - SMALL \n", - "25 2015 MITSUBISHI i-MiEV SUBCOMPACT \n", - "26 2015 NISSAN LEAF MID-SIZE \n", - "27 2015 SMART FORTWO ELECTRIC DRIVE CABRIOLET TWO-SEATER \n", - "28 2015 SMART FORTWO ELECTRIC DRIVE COUPE TWO-SEATER \n", - "29 2015 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - ".. ... ... ... ... \n", - "54 2016 TESLA MODEL S P85D/P90D FULL-SIZE \n", - "55 2016 TESLA MODEL S P90D (Refresh) FULL-SIZE \n", - "56 2016 TESLA MODEL S P100D FULL-SIZE \n", - "57 2016 TESLA MODEL X 60D SUV - STANDARD \n", - "58 2016 TESLA MODEL X 75D SUV - STANDARD \n", - "59 2016 TESLA MODEL X 90D SUV - STANDARD \n", - "60 2016 TESLA MODEL X P90D SUV - STANDARD \n", - "61 2016 TESLA MODEL X P100D SUV - STANDARD \n", - "62 2017 BMW i3 (60 Ah) SUBCOMPACT \n", - "63 2017 BMW i3 (94 Ah) SUBCOMPACT \n", - "64 2017 CHEVROLET BOLT EV STATION WAGON - SMALL \n", - "65 2017 FORD FOCUS ELECTRIC COMPACT \n", - "66 2017 KIA SOUL EV STATION WAGON - SMALL \n", - "67 2017 MITSUBISHI i-MiEV SUBCOMPACT \n", - "68 2017 NISSAN LEAF MID-SIZE \n", - "69 2017 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "70 2017 TESLA MODEL S (75 kWh battery) FULL-SIZE \n", - "71 2017 TESLA MODEL S 60D FULL-SIZE \n", - "72 2017 TESLA MODEL S 75D FULL-SIZE \n", - "73 2017 TESLA MODEL S 90D FULL-SIZE \n", - "74 2017 TESLA MODEL S 100D FULL-SIZE \n", - "75 2017 TESLA MODEL S P90D FULL-SIZE \n", - "76 2017 TESLA MODEL S P100D FULL-SIZE \n", - "77 2017 TESLA MODEL X 60D SUV - STANDARD \n", - "78 2017 TESLA MODEL X 75D SUV - STANDARD \n", - "79 2017 TESLA MODEL X 90D SUV - STANDARD \n", - "80 2017 TESLA MODEL X 100D SUV - STANDARD \n", - "81 2017 TESLA MODEL X P90D SUV - STANDARD \n", - "82 2017 TESLA MODEL X P100D SUV - STANDARD \n", - "83 2017 VOLKSWAGEN e-GOLF COMPACT \n", - "\n", - " FUEL CONSUMPTION Unnamed: 8 Unnamed: 9 \\\n", - "0 TYPE CITY (kWh/100 km) HWY (kWh/100 km) COMB (kWh/100 km) \n", - "1 B 16.9 21.4 18.7 \n", - "2 B 19.3 23 21.1 \n", - "3 B 19 21.1 20 \n", - "4 B 16.9 21.4 18.7 \n", - "5 B 19.3 23 21.1 \n", - "6 B 17.2 22.5 19.6 \n", - "7 B 17.2 22.5 19.6 \n", - "8 B 22.4 21.9 22.2 \n", - "9 B 22.2 21.7 21.9 \n", - "10 B 23.8 23.2 23.6 \n", - "11 B 23.9 23.2 23.6 \n", - "12 B 16 19.6 17.8 \n", - "13 B 19 21.1 20 \n", - "14 B 16.9 21.4 18.7 \n", - "15 B 16.5 20.8 18.4 \n", - "16 B 17.2 22.5 19.6 \n", - "17 B 17.2 22.5 19.6 \n", - "18 B 22.2 21.7 21.9 \n", - "19 B 23.8 23.2 23.6 \n", - "20 B 23.9 23.2 23.6 \n", - "21 B 15.2 18.8 16.8 \n", - "22 B 16 19.6 17.8 \n", - "23 B 19 21.1 20 \n", - "24 B 17.5 22.7 19.9 \n", - "25 B 16.9 21.4 18.7 \n", - "26 B 16.5 20.8 18.4 \n", - "27 B 17.2 22.5 19.6 \n", - "28 B 17.2 22.5 19.6 \n", - "29 B 22.2 21.7 21.9 \n", - ".. ... ... ... ... \n", - "54 B 23.4 21.5 22.5 \n", - "55 B 22.9 21 22.1 \n", - "56 B 22.6 20 21.5 \n", - "57 B 23 22.2 22.6 \n", - "58 B 23 21.9 22.5 \n", - "59 B 23.2 22.2 22.7 \n", - "60 B 23.6 23.3 23.5 \n", - "61 B 25.7 22.9 24.4 \n", - "62 B 15.2 18.8 16.8 \n", - "63 B 16.2 19.7 17.8 \n", - "64 B 16.4 19 17.6 \n", - "65 B 17.7 21.8 19.6 \n", - "66 B 17.4 23 19.9 \n", - "67 B 16.9 20.5 18.7 \n", - "68 B 17 20.7 18.6 \n", - "69 B 21.5 20.7 21.1 \n", - "70 B 21.5 21 21.3 \n", - "71 B 20.6 19.6 20.2 \n", - "72 B 20.6 19.9 20.3 \n", - "73 B 20.6 19.7 20.2 \n", - "74 B 20.7 20.5 20.6 \n", - "75 B 22.8 20.9 22 \n", - "76 B 22.6 20 21.5 \n", - "77 B 23 22.2 22.6 \n", - "78 B 23 21.9 22.5 \n", - "79 B 23.2 22.2 22.7 \n", - "80 B 24.3 23.7 24 \n", - "81 B 23.6 23.3 23.5 \n", - "82 B 25.7 22.9 24.4 \n", - "83 B 16.8 18.6 17.4 \n", - "\n", - " Unnamed: 10 Unnamed: 11 Unnamed: 12 CO2 EMISSIONS CO2 \\\n", - "0 CITY (Le/100 km) HWY (Le/100 km) COMB (Le/100 km) (g/km) RATING \n", - "1 1.9 2.4 2.1 0 n/a \n", - "2 2.2 2.6 2.4 0 n/a \n", - "3 2.1 2.4 2.2 0 n/a \n", - "4 1.9 2.4 2.1 0 n/a \n", - "5 2.2 2.6 2.4 0 n/a \n", - "6 1.9 2.5 2.2 0 n/a \n", - "7 1.9 2.5 2.2 0 n/a \n", - "8 2.5 2.5 2.5 0 n/a \n", - "9 2.5 2.4 2.5 0 n/a \n", - "10 2.7 2.6 2.6 0 n/a \n", - "11 2.7 2.6 2.6 0 n/a \n", - "12 1.8 2.2 2 0 n/a \n", - "13 2.1 2.4 2.2 0 n/a \n", - "14 1.9 2.4 2.1 0 n/a \n", - "15 1.9 2.3 2.1 0 n/a \n", - "16 1.9 2.5 2.2 0 n/a \n", - "17 1.9 2.5 2.2 0 n/a \n", - "18 2.5 2.4 2.5 0 n/a \n", - "19 2.7 2.6 2.6 0 n/a \n", - "20 2.7 2.6 2.6 0 n/a \n", - "21 1.7 2.1 1.9 0 n/a \n", - "22 1.8 2.2 2 0 n/a \n", - "23 2.1 2.4 2.2 0 n/a \n", - "24 2 2.6 2.2 0 n/a \n", - "25 1.9 2.4 2.1 0 n/a \n", - "26 1.9 2.3 2.1 0 n/a \n", - "27 1.9 2.5 2.2 0 n/a \n", - "28 1.9 2.5 2.2 0 n/a \n", - "29 2.5 2.4 2.5 0 n/a \n", - ".. ... ... ... ... ... \n", - "54 2.6 2.4 2.5 0 10 \n", - "55 2.6 2.4 2.5 0 10 \n", - "56 2.5 2.3 2.4 0 10 \n", - "57 2.6 2.5 2.5 0 10 \n", - "58 2.6 2.5 2.5 0 10 \n", - "59 2.6 2.5 2.6 0 10 \n", - "60 2.7 2.6 2.6 0 10 \n", - "61 2.9 2.6 2.7 0 10 \n", - "62 1.7 2.1 1.9 0 10 \n", - "63 1.8 2.2 2 0 10 \n", - "64 1.8 2.1 2 0 10 \n", - "65 2 2.5 2.2 0 10 \n", - "66 2 2.6 2.2 0 10 \n", - "67 1.9 2.3 2.1 0 10 \n", - "68 1.9 2.3 2.1 0 10 \n", - "69 2.4 2.3 2.4 0 10 \n", - "70 2.4 2.4 2.4 0 10 \n", - "71 2.3 2.2 2.3 0 10 \n", - "72 2.3 2.2 2.3 0 10 \n", - "73 2.3 2.2 2.3 0 10 \n", - "74 2.3 2.3 2.3 0 10 \n", - "75 2.6 2.3 2.5 0 10 \n", - "76 2.5 2.3 2.4 0 10 \n", - "77 2.6 2.5 2.5 0 10 \n", - "78 2.6 2.5 2.5 0 10 \n", - "79 2.6 2.5 2.6 0 10 \n", - "80 2.7 2.7 2.7 0 10 \n", - "81 2.7 2.6 2.6 0 10 \n", - "82 2.9 2.6 2.7 0 10 \n", - "83 1.9 2.1 2 0 10 \n", - "\n", - " SMOG RANGE RECHARGE \n", - "0 RATING (km) TIME (h) \n", - "1 n/a 100 7 \n", - "2 n/a 117 7 \n", - "3 n/a 122 4 \n", - "4 n/a 100 7 \n", - "5 n/a 117 7 \n", - "6 n/a 109 8 \n", - "7 n/a 109 8 \n", - "8 n/a 224 6 \n", - "9 n/a 335 10 \n", - "10 n/a 426 12 \n", - "11 n/a 426 12 \n", - "12 n/a 131 7 \n", - "13 n/a 122 4 \n", - "14 n/a 100 7 \n", - "15 n/a 135 5 \n", - "16 n/a 109 8 \n", - "17 n/a 109 8 \n", - "18 n/a 335 10 \n", - "19 n/a 426 12 \n", - "20 n/a 426 12 \n", - "21 n/a 130 4 \n", - "22 n/a 131 7 \n", - "23 n/a 122 4 \n", - "24 n/a 149 4 \n", - "25 n/a 100 7 \n", - "26 n/a 135 5 \n", - "27 n/a 109 8 \n", - "28 n/a 109 8 \n", - "29 n/a 335 10 \n", - ".. ... ... ... \n", - "54 n/a 407 12 \n", - "55 n/a 435 12 \n", - "56 n/a 507 12 \n", - "57 n/a 322 10 \n", - "58 n/a 383 12 \n", - "59 n/a 414 12 \n", - "60 n/a 402 12 \n", - "61 n/a 465 12 \n", - "62 10 130 4 \n", - "63 10 183 5 \n", - "64 10 383 9.3 \n", - "65 10 185 5.5 \n", - "66 10 150 4 \n", - "67 10 100 7 \n", - "68 10 172 6 \n", - "69 10 338 10 \n", - "70 10 401 12 \n", - "71 10 351 10 \n", - "72 10 417 12 \n", - "73 10 473 12 \n", - "74 10 539 12 \n", - "75 10 435 12 \n", - "76 10 507 12 \n", - "77 10 322 10 \n", - "78 10 383 12 \n", - "79 10 414 12 \n", - "80 10 475 12 \n", - "81 10 402 12 \n", - "82 10 465 12 \n", - "83 10 201 5.3 \n", - "\n", - "[84 rows x 16 columns]" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cols = [u'MODEL', u'MAKE', u'MODEL.1', u'VEHICLE CLASS', u'FUEL', u'CONSUMPTION', u'Unnamed: 8', u'Unnamed: 9',\n", - " u'Unnamed: 10', u'Unnamed: 11', u'Unnamed: 12', u'CO2 EMISSIONS', u'CO2 ', u'SMOG', u'RANGE', u'RECHARGE']\n", - "elec=elec[cols] #select only the columns we need\n", - "elec " - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
yearmakemodelvclassfuelcityElechwyEleccombEleccityGashwyGascombGasco2co2RatesmogRatedistrecharge
0YEARNaNNaNNaNTYPECITY (kWh/100 km)HWY (kWh/100 km)COMB (kWh/100 km)CITY (Le/100 km)HWY (Le/100 km)COMB (Le/100 km)(g/km)RATINGRATING(km)TIME (h)
12012MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
22012NISSANLEAFMID-SIZEB19.32321.12.22.62.40n/an/a1177
32013FORDFOCUS ELECTRICCOMPACTB1921.1202.12.42.20n/an/a1224
42013MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
52013NISSANLEAFMID-SIZEB19.32321.12.22.62.40n/an/a1177
62013SMARTFORTWO ELECTRIC DRIVE CABRIOLETTWO-SEATERB17.222.519.61.92.52.20n/an/a1098
72013SMARTFORTWO ELECTRIC DRIVE COUPETWO-SEATERB17.222.519.61.92.52.20n/an/a1098
82013TESLAMODEL S (40 kWh battery)FULL-SIZEB22.421.922.22.52.52.50n/an/a2246
92013TESLAMODEL S (60 kWh battery)FULL-SIZEB22.221.721.92.52.42.50n/an/a33510
102013TESLAMODEL S (85 kWh battery)FULL-SIZEB23.823.223.62.72.62.60n/an/a42612
112013TESLAMODEL S PERFORMANCEFULL-SIZEB23.923.223.62.72.62.60n/an/a42612
122014CHEVROLETSPARK EVSUBCOMPACTB1619.617.81.82.220n/an/a1317
132014FORDFOCUS ELECTRICCOMPACTB1921.1202.12.42.20n/an/a1224
142014MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
152014NISSANLEAFMID-SIZEB16.520.818.41.92.32.10n/an/a1355
162014SMARTFORTWO ELECTRIC DRIVE CABRIOLETTWO-SEATERB17.222.519.61.92.52.20n/an/a1098
172014SMARTFORTWO ELECTRIC DRIVE COUPETWO-SEATERB17.222.519.61.92.52.20n/an/a1098
182014TESLAMODEL S (60 kWh battery)FULL-SIZEB22.221.721.92.52.42.50n/an/a33510
192014TESLAMODEL S (85 kWh battery)FULL-SIZEB23.823.223.62.72.62.60n/an/a42612
202014TESLAMODEL S PERFORMANCEFULL-SIZEB23.923.223.62.72.62.60n/an/a42612
212015BMWi3SUBCOMPACTB15.218.816.81.72.11.90n/an/a1304
222015CHEVROLETSPARK EVSUBCOMPACTB1619.617.81.82.220n/an/a1317
232015FORDFOCUS ELECTRICCOMPACTB1921.1202.12.42.20n/an/a1224
242015KIASOUL EVSTATION WAGON - SMALLB17.522.719.922.62.20n/an/a1494
252015MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
262015NISSANLEAFMID-SIZEB16.520.818.41.92.32.10n/an/a1355
272015SMARTFORTWO ELECTRIC DRIVE CABRIOLETTWO-SEATERB17.222.519.61.92.52.20n/an/a1098
282015SMARTFORTWO ELECTRIC DRIVE COUPETWO-SEATERB17.222.519.61.92.52.20n/an/a1098
292015TESLAMODEL S (60 kWh battery)FULL-SIZEB22.221.721.92.52.42.50n/an/a33510
...................................................
542016TESLAMODEL S P85D/P90DFULL-SIZEB23.421.522.52.62.42.5010n/a40712
552016TESLAMODEL S P90D (Refresh)FULL-SIZEB22.92122.12.62.42.5010n/a43512
562016TESLAMODEL S P100DFULL-SIZEB22.62021.52.52.32.4010n/a50712
572016TESLAMODEL X 60DSUV - STANDARDB2322.222.62.62.52.5010n/a32210
582016TESLAMODEL X 75DSUV - STANDARDB2321.922.52.62.52.5010n/a38312
592016TESLAMODEL X 90DSUV - STANDARDB23.222.222.72.62.52.6010n/a41412
602016TESLAMODEL X P90DSUV - STANDARDB23.623.323.52.72.62.6010n/a40212
612016TESLAMODEL X P100DSUV - STANDARDB25.722.924.42.92.62.7010n/a46512
622017BMWi3 (60 Ah)SUBCOMPACTB15.218.816.81.72.11.9010101304
632017BMWi3 (94 Ah)SUBCOMPACTB16.219.717.81.82.22010101835
642017CHEVROLETBOLT EVSTATION WAGON - SMALLB16.41917.61.82.12010103839.3
652017FORDFOCUS ELECTRICCOMPACTB17.721.819.622.52.2010101855.5
662017KIASOUL EVSTATION WAGON - SMALLB17.42319.922.62.2010101504
672017MITSUBISHIi-MiEVSUBCOMPACTB16.920.518.71.92.32.1010101007
682017NISSANLEAFMID-SIZEB1720.718.61.92.32.1010101726
692017TESLAMODEL S (60 kWh battery)FULL-SIZEB21.520.721.12.42.32.40101033810
702017TESLAMODEL S (75 kWh battery)FULL-SIZEB21.52121.32.42.42.40101040112
712017TESLAMODEL S 60DFULL-SIZEB20.619.620.22.32.22.30101035110
722017TESLAMODEL S 75DFULL-SIZEB20.619.920.32.32.22.30101041712
732017TESLAMODEL S 90DFULL-SIZEB20.619.720.22.32.22.30101047312
742017TESLAMODEL S 100DFULL-SIZEB20.720.520.62.32.32.30101053912
752017TESLAMODEL S P90DFULL-SIZEB22.820.9222.62.32.50101043512
762017TESLAMODEL S P100DFULL-SIZEB22.62021.52.52.32.40101050712
772017TESLAMODEL X 60DSUV - STANDARDB2322.222.62.62.52.50101032210
782017TESLAMODEL X 75DSUV - STANDARDB2321.922.52.62.52.50101038312
792017TESLAMODEL X 90DSUV - STANDARDB23.222.222.72.62.52.60101041412
802017TESLAMODEL X 100DSUV - STANDARDB24.323.7242.72.72.70101047512
812017TESLAMODEL X P90DSUV - STANDARDB23.623.323.52.72.62.60101040212
822017TESLAMODEL X P100DSUV - STANDARDB25.722.924.42.92.62.70101046512
832017VOLKSWAGENe-GOLFCOMPACTB16.818.617.41.92.12010102015.3
\n", - "

84 rows × 16 columns

\n", - "
" - ], - "text/plain": [ - " year make model vclass \\\n", - "0 YEAR NaN NaN NaN \n", - "1 2012 MITSUBISHI i-MiEV SUBCOMPACT \n", - "2 2012 NISSAN LEAF MID-SIZE \n", - "3 2013 FORD FOCUS ELECTRIC COMPACT \n", - "4 2013 MITSUBISHI i-MiEV SUBCOMPACT \n", - "5 2013 NISSAN LEAF MID-SIZE \n", - "6 2013 SMART FORTWO ELECTRIC DRIVE CABRIOLET TWO-SEATER \n", - "7 2013 SMART FORTWO ELECTRIC DRIVE COUPE TWO-SEATER \n", - "8 2013 TESLA MODEL S (40 kWh battery) FULL-SIZE \n", - "9 2013 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "10 2013 TESLA MODEL S (85 kWh battery) FULL-SIZE \n", - "11 2013 TESLA MODEL S PERFORMANCE FULL-SIZE \n", - "12 2014 CHEVROLET SPARK EV SUBCOMPACT \n", - "13 2014 FORD FOCUS ELECTRIC COMPACT \n", - "14 2014 MITSUBISHI i-MiEV SUBCOMPACT \n", - "15 2014 NISSAN LEAF MID-SIZE \n", - "16 2014 SMART FORTWO ELECTRIC DRIVE CABRIOLET TWO-SEATER \n", - "17 2014 SMART FORTWO ELECTRIC DRIVE COUPE TWO-SEATER \n", - "18 2014 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "19 2014 TESLA MODEL S (85 kWh battery) FULL-SIZE \n", - "20 2014 TESLA MODEL S PERFORMANCE FULL-SIZE \n", - "21 2015 BMW i3 SUBCOMPACT \n", - "22 2015 CHEVROLET SPARK EV SUBCOMPACT \n", - "23 2015 FORD FOCUS ELECTRIC COMPACT \n", - "24 2015 KIA SOUL EV STATION WAGON - SMALL \n", - "25 2015 MITSUBISHI i-MiEV SUBCOMPACT \n", - "26 2015 NISSAN LEAF MID-SIZE \n", - "27 2015 SMART FORTWO ELECTRIC DRIVE CABRIOLET TWO-SEATER \n", - "28 2015 SMART FORTWO ELECTRIC DRIVE COUPE TWO-SEATER \n", - "29 2015 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - ".. ... ... ... ... \n", - "54 2016 TESLA MODEL S P85D/P90D FULL-SIZE \n", - "55 2016 TESLA MODEL S P90D (Refresh) FULL-SIZE \n", - "56 2016 TESLA MODEL S P100D FULL-SIZE \n", - "57 2016 TESLA MODEL X 60D SUV - STANDARD \n", - "58 2016 TESLA MODEL X 75D SUV - STANDARD \n", - "59 2016 TESLA MODEL X 90D SUV - STANDARD \n", - "60 2016 TESLA MODEL X P90D SUV - STANDARD \n", - "61 2016 TESLA MODEL X P100D SUV - STANDARD \n", - "62 2017 BMW i3 (60 Ah) SUBCOMPACT \n", - "63 2017 BMW i3 (94 Ah) SUBCOMPACT \n", - "64 2017 CHEVROLET BOLT EV STATION WAGON - SMALL \n", - "65 2017 FORD FOCUS ELECTRIC COMPACT \n", - "66 2017 KIA SOUL EV STATION WAGON - SMALL \n", - "67 2017 MITSUBISHI i-MiEV SUBCOMPACT \n", - "68 2017 NISSAN LEAF MID-SIZE \n", - "69 2017 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "70 2017 TESLA MODEL S (75 kWh battery) FULL-SIZE \n", - "71 2017 TESLA MODEL S 60D FULL-SIZE \n", - "72 2017 TESLA MODEL S 75D FULL-SIZE \n", - "73 2017 TESLA MODEL S 90D FULL-SIZE \n", - "74 2017 TESLA MODEL S 100D FULL-SIZE \n", - "75 2017 TESLA MODEL S P90D FULL-SIZE \n", - "76 2017 TESLA MODEL S P100D FULL-SIZE \n", - "77 2017 TESLA MODEL X 60D SUV - STANDARD \n", - "78 2017 TESLA MODEL X 75D SUV - STANDARD \n", - "79 2017 TESLA MODEL X 90D SUV - STANDARD \n", - "80 2017 TESLA MODEL X 100D SUV - STANDARD \n", - "81 2017 TESLA MODEL X P90D SUV - STANDARD \n", - "82 2017 TESLA MODEL X P100D SUV - STANDARD \n", - "83 2017 VOLKSWAGEN e-GOLF COMPACT \n", - "\n", - " fuel cityElec hwyElec combElec \\\n", - "0 TYPE CITY (kWh/100 km) HWY (kWh/100 km) COMB (kWh/100 km) \n", - "1 B 16.9 21.4 18.7 \n", - "2 B 19.3 23 21.1 \n", - "3 B 19 21.1 20 \n", - "4 B 16.9 21.4 18.7 \n", - "5 B 19.3 23 21.1 \n", - "6 B 17.2 22.5 19.6 \n", - "7 B 17.2 22.5 19.6 \n", - "8 B 22.4 21.9 22.2 \n", - "9 B 22.2 21.7 21.9 \n", - "10 B 23.8 23.2 23.6 \n", - "11 B 23.9 23.2 23.6 \n", - "12 B 16 19.6 17.8 \n", - "13 B 19 21.1 20 \n", - "14 B 16.9 21.4 18.7 \n", - "15 B 16.5 20.8 18.4 \n", - "16 B 17.2 22.5 19.6 \n", - "17 B 17.2 22.5 19.6 \n", - "18 B 22.2 21.7 21.9 \n", - "19 B 23.8 23.2 23.6 \n", - "20 B 23.9 23.2 23.6 \n", - "21 B 15.2 18.8 16.8 \n", - "22 B 16 19.6 17.8 \n", - "23 B 19 21.1 20 \n", - "24 B 17.5 22.7 19.9 \n", - "25 B 16.9 21.4 18.7 \n", - "26 B 16.5 20.8 18.4 \n", - "27 B 17.2 22.5 19.6 \n", - "28 B 17.2 22.5 19.6 \n", - "29 B 22.2 21.7 21.9 \n", - ".. ... ... ... ... \n", - "54 B 23.4 21.5 22.5 \n", - "55 B 22.9 21 22.1 \n", - "56 B 22.6 20 21.5 \n", - "57 B 23 22.2 22.6 \n", - "58 B 23 21.9 22.5 \n", - "59 B 23.2 22.2 22.7 \n", - "60 B 23.6 23.3 23.5 \n", - "61 B 25.7 22.9 24.4 \n", - "62 B 15.2 18.8 16.8 \n", - "63 B 16.2 19.7 17.8 \n", - "64 B 16.4 19 17.6 \n", - "65 B 17.7 21.8 19.6 \n", - "66 B 17.4 23 19.9 \n", - "67 B 16.9 20.5 18.7 \n", - "68 B 17 20.7 18.6 \n", - "69 B 21.5 20.7 21.1 \n", - "70 B 21.5 21 21.3 \n", - "71 B 20.6 19.6 20.2 \n", - "72 B 20.6 19.9 20.3 \n", - "73 B 20.6 19.7 20.2 \n", - "74 B 20.7 20.5 20.6 \n", - "75 B 22.8 20.9 22 \n", - "76 B 22.6 20 21.5 \n", - "77 B 23 22.2 22.6 \n", - "78 B 23 21.9 22.5 \n", - "79 B 23.2 22.2 22.7 \n", - "80 B 24.3 23.7 24 \n", - "81 B 23.6 23.3 23.5 \n", - "82 B 25.7 22.9 24.4 \n", - "83 B 16.8 18.6 17.4 \n", - "\n", - " cityGas hwyGas combGas co2 co2Rate \\\n", - "0 CITY (Le/100 km) HWY (Le/100 km) COMB (Le/100 km) (g/km) RATING \n", - "1 1.9 2.4 2.1 0 n/a \n", - "2 2.2 2.6 2.4 0 n/a \n", - "3 2.1 2.4 2.2 0 n/a \n", - "4 1.9 2.4 2.1 0 n/a \n", - "5 2.2 2.6 2.4 0 n/a \n", - "6 1.9 2.5 2.2 0 n/a \n", - "7 1.9 2.5 2.2 0 n/a \n", - "8 2.5 2.5 2.5 0 n/a \n", - "9 2.5 2.4 2.5 0 n/a \n", - "10 2.7 2.6 2.6 0 n/a \n", - "11 2.7 2.6 2.6 0 n/a \n", - "12 1.8 2.2 2 0 n/a \n", - "13 2.1 2.4 2.2 0 n/a \n", - "14 1.9 2.4 2.1 0 n/a \n", - "15 1.9 2.3 2.1 0 n/a \n", - "16 1.9 2.5 2.2 0 n/a \n", - "17 1.9 2.5 2.2 0 n/a \n", - "18 2.5 2.4 2.5 0 n/a \n", - "19 2.7 2.6 2.6 0 n/a \n", - "20 2.7 2.6 2.6 0 n/a \n", - "21 1.7 2.1 1.9 0 n/a \n", - "22 1.8 2.2 2 0 n/a \n", - "23 2.1 2.4 2.2 0 n/a \n", - "24 2 2.6 2.2 0 n/a \n", - "25 1.9 2.4 2.1 0 n/a \n", - "26 1.9 2.3 2.1 0 n/a \n", - "27 1.9 2.5 2.2 0 n/a \n", - "28 1.9 2.5 2.2 0 n/a \n", - "29 2.5 2.4 2.5 0 n/a \n", - ".. ... ... ... ... ... \n", - "54 2.6 2.4 2.5 0 10 \n", - "55 2.6 2.4 2.5 0 10 \n", - "56 2.5 2.3 2.4 0 10 \n", - "57 2.6 2.5 2.5 0 10 \n", - "58 2.6 2.5 2.5 0 10 \n", - "59 2.6 2.5 2.6 0 10 \n", - "60 2.7 2.6 2.6 0 10 \n", - "61 2.9 2.6 2.7 0 10 \n", - "62 1.7 2.1 1.9 0 10 \n", - "63 1.8 2.2 2 0 10 \n", - "64 1.8 2.1 2 0 10 \n", - "65 2 2.5 2.2 0 10 \n", - "66 2 2.6 2.2 0 10 \n", - "67 1.9 2.3 2.1 0 10 \n", - "68 1.9 2.3 2.1 0 10 \n", - "69 2.4 2.3 2.4 0 10 \n", - "70 2.4 2.4 2.4 0 10 \n", - "71 2.3 2.2 2.3 0 10 \n", - "72 2.3 2.2 2.3 0 10 \n", - "73 2.3 2.2 2.3 0 10 \n", - "74 2.3 2.3 2.3 0 10 \n", - "75 2.6 2.3 2.5 0 10 \n", - "76 2.5 2.3 2.4 0 10 \n", - "77 2.6 2.5 2.5 0 10 \n", - "78 2.6 2.5 2.5 0 10 \n", - "79 2.6 2.5 2.6 0 10 \n", - "80 2.7 2.7 2.7 0 10 \n", - "81 2.7 2.6 2.6 0 10 \n", - "82 2.9 2.6 2.7 0 10 \n", - "83 1.9 2.1 2 0 10 \n", - "\n", - " smogRate dist recharge \n", - "0 RATING (km) TIME (h) \n", - "1 n/a 100 7 \n", - "2 n/a 117 7 \n", - "3 n/a 122 4 \n", - "4 n/a 100 7 \n", - "5 n/a 117 7 \n", - "6 n/a 109 8 \n", - "7 n/a 109 8 \n", - "8 n/a 224 6 \n", - "9 n/a 335 10 \n", - "10 n/a 426 12 \n", - "11 n/a 426 12 \n", - "12 n/a 131 7 \n", - "13 n/a 122 4 \n", - "14 n/a 100 7 \n", - "15 n/a 135 5 \n", - "16 n/a 109 8 \n", - "17 n/a 109 8 \n", - "18 n/a 335 10 \n", - "19 n/a 426 12 \n", - "20 n/a 426 12 \n", - "21 n/a 130 4 \n", - "22 n/a 131 7 \n", - "23 n/a 122 4 \n", - "24 n/a 149 4 \n", - "25 n/a 100 7 \n", - "26 n/a 135 5 \n", - "27 n/a 109 8 \n", - "28 n/a 109 8 \n", - "29 n/a 335 10 \n", - ".. ... ... ... \n", - "54 n/a 407 12 \n", - "55 n/a 435 12 \n", - "56 n/a 507 12 \n", - "57 n/a 322 10 \n", - "58 n/a 383 12 \n", - "59 n/a 414 12 \n", - "60 n/a 402 12 \n", - "61 n/a 465 12 \n", - "62 10 130 4 \n", - "63 10 183 5 \n", - "64 10 383 9.3 \n", - "65 10 185 5.5 \n", - "66 10 150 4 \n", - "67 10 100 7 \n", - "68 10 172 6 \n", - "69 10 338 10 \n", - "70 10 401 12 \n", - "71 10 351 10 \n", - "72 10 417 12 \n", - "73 10 473 12 \n", - "74 10 539 12 \n", - "75 10 435 12 \n", - "76 10 507 12 \n", - "77 10 322 10 \n", - "78 10 383 12 \n", - "79 10 414 12 \n", - "80 10 475 12 \n", - "81 10 402 12 \n", - "82 10 465 12 \n", - "83 10 201 5.3 \n", - "\n", - "[84 rows x 16 columns]" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "newcols = {'MODEL': 'year', 'MAKE':'make', 'MODEL.1':'model', 'VEHICLE CLASS':'vclass', 'FUEL':'fuel', 'CONSUMPTION':'cityElec', 'Unnamed: 8':'hwyElec', 'Unnamed: 9':'combElec',\n", - " 'Unnamed: 10':'cityGas', 'Unnamed: 11':'hwyGas', 'Unnamed: 12':'combGas', 'CO2 EMISSIONS':'co2', 'CO2 ':'co2Rate', 'SMOG':'smogRate', 'RANGE':'dist', u'RECHARGE':'recharge'}\n", - "elec.rename(columns=newcols, inplace=True)\n", - "elec" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
yearmakemodelvclassfuelcityElechwyEleccombEleccityGashwyGascombGasco2co2RatesmogRatedistrecharge
12012MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
22012NISSANLEAFMID-SIZEB19.32321.12.22.62.40n/an/a1177
32013FORDFOCUS ELECTRICCOMPACTB1921.1202.12.42.20n/an/a1224
42013MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
52013NISSANLEAFMID-SIZEB19.32321.12.22.62.40n/an/a1177
62013SMARTFORTWO ELECTRIC DRIVE CABRIOLETTWO-SEATERB17.222.519.61.92.52.20n/an/a1098
72013SMARTFORTWO ELECTRIC DRIVE COUPETWO-SEATERB17.222.519.61.92.52.20n/an/a1098
82013TESLAMODEL S (40 kWh battery)FULL-SIZEB22.421.922.22.52.52.50n/an/a2246
92013TESLAMODEL S (60 kWh battery)FULL-SIZEB22.221.721.92.52.42.50n/an/a33510
102013TESLAMODEL S (85 kWh battery)FULL-SIZEB23.823.223.62.72.62.60n/an/a42612
112013TESLAMODEL S PERFORMANCEFULL-SIZEB23.923.223.62.72.62.60n/an/a42612
122014CHEVROLETSPARK EVSUBCOMPACTB1619.617.81.82.220n/an/a1317
132014FORDFOCUS ELECTRICCOMPACTB1921.1202.12.42.20n/an/a1224
142014MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
152014NISSANLEAFMID-SIZEB16.520.818.41.92.32.10n/an/a1355
162014SMARTFORTWO ELECTRIC DRIVE CABRIOLETTWO-SEATERB17.222.519.61.92.52.20n/an/a1098
172014SMARTFORTWO ELECTRIC DRIVE COUPETWO-SEATERB17.222.519.61.92.52.20n/an/a1098
182014TESLAMODEL S (60 kWh battery)FULL-SIZEB22.221.721.92.52.42.50n/an/a33510
192014TESLAMODEL S (85 kWh battery)FULL-SIZEB23.823.223.62.72.62.60n/an/a42612
202014TESLAMODEL S PERFORMANCEFULL-SIZEB23.923.223.62.72.62.60n/an/a42612
212015BMWi3SUBCOMPACTB15.218.816.81.72.11.90n/an/a1304
222015CHEVROLETSPARK EVSUBCOMPACTB1619.617.81.82.220n/an/a1317
232015FORDFOCUS ELECTRICCOMPACTB1921.1202.12.42.20n/an/a1224
242015KIASOUL EVSTATION WAGON - SMALLB17.522.719.922.62.20n/an/a1494
252015MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
262015NISSANLEAFMID-SIZEB16.520.818.41.92.32.10n/an/a1355
272015SMARTFORTWO ELECTRIC DRIVE CABRIOLETTWO-SEATERB17.222.519.61.92.52.20n/an/a1098
282015SMARTFORTWO ELECTRIC DRIVE COUPETWO-SEATERB17.222.519.61.92.52.20n/an/a1098
292015TESLAMODEL S (60 kWh battery)FULL-SIZEB22.221.721.92.52.42.50n/an/a33510
302015TESLAMODEL S (70 kWh battery)FULL-SIZEB23.823.223.62.72.62.60n/an/a37712
...................................................
542016TESLAMODEL S P85D/P90DFULL-SIZEB23.421.522.52.62.42.5010n/a40712
552016TESLAMODEL S P90D (Refresh)FULL-SIZEB22.92122.12.62.42.5010n/a43512
562016TESLAMODEL S P100DFULL-SIZEB22.62021.52.52.32.4010n/a50712
572016TESLAMODEL X 60DSUV - STANDARDB2322.222.62.62.52.5010n/a32210
582016TESLAMODEL X 75DSUV - STANDARDB2321.922.52.62.52.5010n/a38312
592016TESLAMODEL X 90DSUV - STANDARDB23.222.222.72.62.52.6010n/a41412
602016TESLAMODEL X P90DSUV - STANDARDB23.623.323.52.72.62.6010n/a40212
612016TESLAMODEL X P100DSUV - STANDARDB25.722.924.42.92.62.7010n/a46512
622017BMWi3 (60 Ah)SUBCOMPACTB15.218.816.81.72.11.9010101304
632017BMWi3 (94 Ah)SUBCOMPACTB16.219.717.81.82.22010101835
642017CHEVROLETBOLT EVSTATION WAGON - SMALLB16.41917.61.82.12010103839.3
652017FORDFOCUS ELECTRICCOMPACTB17.721.819.622.52.2010101855.5
662017KIASOUL EVSTATION WAGON - SMALLB17.42319.922.62.2010101504
672017MITSUBISHIi-MiEVSUBCOMPACTB16.920.518.71.92.32.1010101007
682017NISSANLEAFMID-SIZEB1720.718.61.92.32.1010101726
692017TESLAMODEL S (60 kWh battery)FULL-SIZEB21.520.721.12.42.32.40101033810
702017TESLAMODEL S (75 kWh battery)FULL-SIZEB21.52121.32.42.42.40101040112
712017TESLAMODEL S 60DFULL-SIZEB20.619.620.22.32.22.30101035110
722017TESLAMODEL S 75DFULL-SIZEB20.619.920.32.32.22.30101041712
732017TESLAMODEL S 90DFULL-SIZEB20.619.720.22.32.22.30101047312
742017TESLAMODEL S 100DFULL-SIZEB20.720.520.62.32.32.30101053912
752017TESLAMODEL S P90DFULL-SIZEB22.820.9222.62.32.50101043512
762017TESLAMODEL S P100DFULL-SIZEB22.62021.52.52.32.40101050712
772017TESLAMODEL X 60DSUV - STANDARDB2322.222.62.62.52.50101032210
782017TESLAMODEL X 75DSUV - STANDARDB2321.922.52.62.52.50101038312
792017TESLAMODEL X 90DSUV - STANDARDB23.222.222.72.62.52.60101041412
802017TESLAMODEL X 100DSUV - STANDARDB24.323.7242.72.72.70101047512
812017TESLAMODEL X P90DSUV - STANDARDB23.623.323.52.72.62.60101040212
822017TESLAMODEL X P100DSUV - STANDARDB25.722.924.42.92.62.70101046512
832017VOLKSWAGENe-GOLFCOMPACTB16.818.617.41.92.12010102015.3
\n", - "

83 rows × 16 columns

\n", - "
" - ], - "text/plain": [ - " year make model vclass \\\n", - "1 2012 MITSUBISHI i-MiEV SUBCOMPACT \n", - "2 2012 NISSAN LEAF MID-SIZE \n", - "3 2013 FORD FOCUS ELECTRIC COMPACT \n", - "4 2013 MITSUBISHI i-MiEV SUBCOMPACT \n", - "5 2013 NISSAN LEAF MID-SIZE \n", - "6 2013 SMART FORTWO ELECTRIC DRIVE CABRIOLET TWO-SEATER \n", - "7 2013 SMART FORTWO ELECTRIC DRIVE COUPE TWO-SEATER \n", - "8 2013 TESLA MODEL S (40 kWh battery) FULL-SIZE \n", - "9 2013 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "10 2013 TESLA MODEL S (85 kWh battery) FULL-SIZE \n", - "11 2013 TESLA MODEL S PERFORMANCE FULL-SIZE \n", - "12 2014 CHEVROLET SPARK EV SUBCOMPACT \n", - "13 2014 FORD FOCUS ELECTRIC COMPACT \n", - "14 2014 MITSUBISHI i-MiEV SUBCOMPACT \n", - "15 2014 NISSAN LEAF MID-SIZE \n", - "16 2014 SMART FORTWO ELECTRIC DRIVE CABRIOLET TWO-SEATER \n", - "17 2014 SMART FORTWO ELECTRIC DRIVE COUPE TWO-SEATER \n", - "18 2014 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "19 2014 TESLA MODEL S (85 kWh battery) FULL-SIZE \n", - "20 2014 TESLA MODEL S PERFORMANCE FULL-SIZE \n", - "21 2015 BMW i3 SUBCOMPACT \n", - "22 2015 CHEVROLET SPARK EV SUBCOMPACT \n", - "23 2015 FORD FOCUS ELECTRIC COMPACT \n", - "24 2015 KIA SOUL EV STATION WAGON - SMALL \n", - "25 2015 MITSUBISHI i-MiEV SUBCOMPACT \n", - "26 2015 NISSAN LEAF MID-SIZE \n", - "27 2015 SMART FORTWO ELECTRIC DRIVE CABRIOLET TWO-SEATER \n", - "28 2015 SMART FORTWO ELECTRIC DRIVE COUPE TWO-SEATER \n", - "29 2015 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "30 2015 TESLA MODEL S (70 kWh battery) FULL-SIZE \n", - ".. ... ... ... ... \n", - "54 2016 TESLA MODEL S P85D/P90D FULL-SIZE \n", - "55 2016 TESLA MODEL S P90D (Refresh) FULL-SIZE \n", - "56 2016 TESLA MODEL S P100D FULL-SIZE \n", - "57 2016 TESLA MODEL X 60D SUV - STANDARD \n", - "58 2016 TESLA MODEL X 75D SUV - STANDARD \n", - "59 2016 TESLA MODEL X 90D SUV - STANDARD \n", - "60 2016 TESLA MODEL X P90D SUV - STANDARD \n", - "61 2016 TESLA MODEL X P100D SUV - STANDARD \n", - "62 2017 BMW i3 (60 Ah) SUBCOMPACT \n", - "63 2017 BMW i3 (94 Ah) SUBCOMPACT \n", - "64 2017 CHEVROLET BOLT EV STATION WAGON - SMALL \n", - "65 2017 FORD FOCUS ELECTRIC COMPACT \n", - "66 2017 KIA SOUL EV STATION WAGON - SMALL \n", - "67 2017 MITSUBISHI i-MiEV SUBCOMPACT \n", - "68 2017 NISSAN LEAF MID-SIZE \n", - "69 2017 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "70 2017 TESLA MODEL S (75 kWh battery) FULL-SIZE \n", - "71 2017 TESLA MODEL S 60D FULL-SIZE \n", - "72 2017 TESLA MODEL S 75D FULL-SIZE \n", - "73 2017 TESLA MODEL S 90D FULL-SIZE \n", - "74 2017 TESLA MODEL S 100D FULL-SIZE \n", - "75 2017 TESLA MODEL S P90D FULL-SIZE \n", - "76 2017 TESLA MODEL S P100D FULL-SIZE \n", - "77 2017 TESLA MODEL X 60D SUV - STANDARD \n", - "78 2017 TESLA MODEL X 75D SUV - STANDARD \n", - "79 2017 TESLA MODEL X 90D SUV - STANDARD \n", - "80 2017 TESLA MODEL X 100D SUV - STANDARD \n", - "81 2017 TESLA MODEL X P90D SUV - STANDARD \n", - "82 2017 TESLA MODEL X P100D SUV - STANDARD \n", - "83 2017 VOLKSWAGEN e-GOLF COMPACT \n", - "\n", - " fuel cityElec hwyElec combElec cityGas hwyGas combGas co2 co2Rate smogRate \\\n", - "1 B 16.9 21.4 18.7 1.9 2.4 2.1 0 n/a n/a \n", - "2 B 19.3 23 21.1 2.2 2.6 2.4 0 n/a n/a \n", - "3 B 19 21.1 20 2.1 2.4 2.2 0 n/a n/a \n", - "4 B 16.9 21.4 18.7 1.9 2.4 2.1 0 n/a n/a \n", - "5 B 19.3 23 21.1 2.2 2.6 2.4 0 n/a n/a \n", - "6 B 17.2 22.5 19.6 1.9 2.5 2.2 0 n/a n/a \n", - "7 B 17.2 22.5 19.6 1.9 2.5 2.2 0 n/a n/a \n", - "8 B 22.4 21.9 22.2 2.5 2.5 2.5 0 n/a n/a \n", - "9 B 22.2 21.7 21.9 2.5 2.4 2.5 0 n/a n/a \n", - "10 B 23.8 23.2 23.6 2.7 2.6 2.6 0 n/a n/a \n", - "11 B 23.9 23.2 23.6 2.7 2.6 2.6 0 n/a n/a \n", - "12 B 16 19.6 17.8 1.8 2.2 2 0 n/a n/a \n", - "13 B 19 21.1 20 2.1 2.4 2.2 0 n/a n/a \n", - "14 B 16.9 21.4 18.7 1.9 2.4 2.1 0 n/a n/a \n", - "15 B 16.5 20.8 18.4 1.9 2.3 2.1 0 n/a n/a \n", - "16 B 17.2 22.5 19.6 1.9 2.5 2.2 0 n/a n/a \n", - "17 B 17.2 22.5 19.6 1.9 2.5 2.2 0 n/a n/a \n", - "18 B 22.2 21.7 21.9 2.5 2.4 2.5 0 n/a n/a \n", - "19 B 23.8 23.2 23.6 2.7 2.6 2.6 0 n/a n/a \n", - "20 B 23.9 23.2 23.6 2.7 2.6 2.6 0 n/a n/a \n", - "21 B 15.2 18.8 16.8 1.7 2.1 1.9 0 n/a n/a \n", - "22 B 16 19.6 17.8 1.8 2.2 2 0 n/a n/a \n", - "23 B 19 21.1 20 2.1 2.4 2.2 0 n/a n/a \n", - "24 B 17.5 22.7 19.9 2 2.6 2.2 0 n/a n/a \n", - "25 B 16.9 21.4 18.7 1.9 2.4 2.1 0 n/a n/a \n", - "26 B 16.5 20.8 18.4 1.9 2.3 2.1 0 n/a n/a \n", - "27 B 17.2 22.5 19.6 1.9 2.5 2.2 0 n/a n/a \n", - "28 B 17.2 22.5 19.6 1.9 2.5 2.2 0 n/a n/a \n", - "29 B 22.2 21.7 21.9 2.5 2.4 2.5 0 n/a n/a \n", - "30 B 23.8 23.2 23.6 2.7 2.6 2.6 0 n/a n/a \n", - ".. ... ... ... ... ... ... ... .. ... ... \n", - "54 B 23.4 21.5 22.5 2.6 2.4 2.5 0 10 n/a \n", - "55 B 22.9 21 22.1 2.6 2.4 2.5 0 10 n/a \n", - "56 B 22.6 20 21.5 2.5 2.3 2.4 0 10 n/a \n", - "57 B 23 22.2 22.6 2.6 2.5 2.5 0 10 n/a \n", - "58 B 23 21.9 22.5 2.6 2.5 2.5 0 10 n/a \n", - "59 B 23.2 22.2 22.7 2.6 2.5 2.6 0 10 n/a \n", - "60 B 23.6 23.3 23.5 2.7 2.6 2.6 0 10 n/a \n", - "61 B 25.7 22.9 24.4 2.9 2.6 2.7 0 10 n/a \n", - "62 B 15.2 18.8 16.8 1.7 2.1 1.9 0 10 10 \n", - "63 B 16.2 19.7 17.8 1.8 2.2 2 0 10 10 \n", - "64 B 16.4 19 17.6 1.8 2.1 2 0 10 10 \n", - "65 B 17.7 21.8 19.6 2 2.5 2.2 0 10 10 \n", - "66 B 17.4 23 19.9 2 2.6 2.2 0 10 10 \n", - "67 B 16.9 20.5 18.7 1.9 2.3 2.1 0 10 10 \n", - "68 B 17 20.7 18.6 1.9 2.3 2.1 0 10 10 \n", - "69 B 21.5 20.7 21.1 2.4 2.3 2.4 0 10 10 \n", - "70 B 21.5 21 21.3 2.4 2.4 2.4 0 10 10 \n", - "71 B 20.6 19.6 20.2 2.3 2.2 2.3 0 10 10 \n", - "72 B 20.6 19.9 20.3 2.3 2.2 2.3 0 10 10 \n", - "73 B 20.6 19.7 20.2 2.3 2.2 2.3 0 10 10 \n", - "74 B 20.7 20.5 20.6 2.3 2.3 2.3 0 10 10 \n", - "75 B 22.8 20.9 22 2.6 2.3 2.5 0 10 10 \n", - "76 B 22.6 20 21.5 2.5 2.3 2.4 0 10 10 \n", - "77 B 23 22.2 22.6 2.6 2.5 2.5 0 10 10 \n", - "78 B 23 21.9 22.5 2.6 2.5 2.5 0 10 10 \n", - "79 B 23.2 22.2 22.7 2.6 2.5 2.6 0 10 10 \n", - "80 B 24.3 23.7 24 2.7 2.7 2.7 0 10 10 \n", - "81 B 23.6 23.3 23.5 2.7 2.6 2.6 0 10 10 \n", - "82 B 25.7 22.9 24.4 2.9 2.6 2.7 0 10 10 \n", - "83 B 16.8 18.6 17.4 1.9 2.1 2 0 10 10 \n", - "\n", - " dist recharge \n", - "1 100 7 \n", - "2 117 7 \n", - "3 122 4 \n", - "4 100 7 \n", - "5 117 7 \n", - "6 109 8 \n", - "7 109 8 \n", - "8 224 6 \n", - "9 335 10 \n", - "10 426 12 \n", - "11 426 12 \n", - "12 131 7 \n", - "13 122 4 \n", - "14 100 7 \n", - "15 135 5 \n", - "16 109 8 \n", - "17 109 8 \n", - "18 335 10 \n", - "19 426 12 \n", - "20 426 12 \n", - "21 130 4 \n", - "22 131 7 \n", - "23 122 4 \n", - "24 149 4 \n", - "25 100 7 \n", - "26 135 5 \n", - "27 109 8 \n", - "28 109 8 \n", - "29 335 10 \n", - "30 377 12 \n", - ".. ... ... \n", - "54 407 12 \n", - "55 435 12 \n", - "56 507 12 \n", - "57 322 10 \n", - "58 383 12 \n", - "59 414 12 \n", - "60 402 12 \n", - "61 465 12 \n", - "62 130 4 \n", - "63 183 5 \n", - "64 383 9.3 \n", - "65 185 5.5 \n", - "66 150 4 \n", - "67 100 7 \n", - "68 172 6 \n", - "69 338 10 \n", - "70 401 12 \n", - "71 351 10 \n", - "72 417 12 \n", - "73 473 12 \n", - "74 539 12 \n", - "75 435 12 \n", - "76 507 12 \n", - "77 322 10 \n", - "78 383 12 \n", - "79 414 12 \n", - "80 475 12 \n", - "81 402 12 \n", - "82 465 12 \n", - "83 201 5.3 \n", - "\n", - "[83 rows x 16 columns]" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "elec = elec.drop(elec.index[0])\n", - "elec" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
yearmakemodelvclassfuelcityElechwyEleccombEleccityGashwyGascombGasco2co2RatesmogRatedistrecharge
count83838383838383838383838383838383
unique610407132282912791223310
top2016TESLAi-MiEVFULL-SIZEB17.222.519.61.92.42.2010n/a10912
freq273763483889201816834961834
\n", - "
" - ], - "text/plain": [ - " year make model vclass fuel cityElec hwyElec combElec cityGas \\\n", - "count 83 83 83 83 83 83 83 83 83 \n", - "unique 6 10 40 7 1 32 28 29 12 \n", - "top 2016 TESLA i-MiEV FULL-SIZE B 17.2 22.5 19.6 1.9 \n", - "freq 27 37 6 34 83 8 8 9 20 \n", - "\n", - " hwyGas combGas co2 co2Rate smogRate dist recharge \n", - "count 83 83 83 83 83 83 83 \n", - "unique 7 9 1 2 2 33 10 \n", - "top 2.4 2.2 0 10 n/a 109 12 \n", - "freq 18 16 83 49 61 8 34 " - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "elec.describe()" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "array(['SUBCOMPACT', 'MID-SIZE', 'COMPACT', 'TWO-SEATER', 'FULL-SIZE',\n", - " 'STATION WAGON - SMALL', 'SUV - STANDARD'], dtype=object)" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "elec.vclass.unique()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Understanding the Table\tfor normal cars\t\t\t\t\t\t\t\t\t\t\t\n", - "Model\t4WD/4X4 = Four-wheel drive\t\t\t\t\t\t\t\t\t\t\t\n", - "\tAWD = All-wheel drive\t\t\t\t\t\t\t\t\t\t\t\n", - "\tCNG = Compressed natural gas\t\t\t\t\t\t\t\t\t\t\t\n", - "\tFFV = Flexible-fuel vehicle\t\t\t\t\t\t\t\t\t\t\t\n", - "\tNGV = Natural gas vehicle\t\t\t\t\t\t\t\t\t\t\t\n", - "\t# = High output engine that provides more power than the standard engine of the same size\t\t\t\t\t\t\t\t\t\t\t\n", - "Transmission\tA = Automatic\t\t\t\t\t\t\t\t\t\t\t\n", - "\tAM = Automated manual\t\t\t\t\t\t\t\t\t\t\t\n", - "\tAS = Automatic with select shift\t\t\t\t\t\t\t\t\t\t\t\n", - "\tAV = Continuously variable\t\t\t\t\t\t\t\t\t\t\t\n", - "\tM = Manual\t\t\t\t\t\t\t\t\t\t\t\n", - "\t3 – 10 = Number of gears\t\t\t\t\t\t\t\t\t\t\t\n", - "Fuel Type\tX = Regular gasoline\t\t\t\t\t\t\t\t\t\t\t\n", - "\tZ = Premium gasoline\t\t\t\t\t\t\t\t\t\t\t\n", - "\tD = Diesel\t\t\t\t\t\t\t\t\t\t\t\n", - "\tE = Ethanol (E85)\t\t\t\t\t\t\t\t\t\t\t\n", - "\tN = Natural Gas\t\t\t\t\t\t\t\t\t\t\t\n", - "Fuel Consumption\tCity and highway fuel consumption ratings are shown in litres per 100 kilometres (L/100 km) - combined rating (55% city, 45% hwy) is shown in L/100 km and in miles per imperial gallon (mpg)\t\t\t\t\t\t\t\t\t\t\t\n", - "CO2 Emissions (g/km)\tEstimated tailpipe carbon dioxide emissions (in grams per kilometre) are based on fuel type and the combined fuel consumption rating.\t\t\t\t\t\t\t\t\t\t\t\n" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
MODELMAKEMODEL.1VEHICLE CLASSENGINE SIZECYLINDERSTRANSMISSIONFUELFUEL CONSUMPTIONUnnamed: 9Unnamed: 10Unnamed: 11CO2 EMISSIONS
02000ACURA1.6ELCOMPACT1.64A4X9.26.78.135186
12000ACURA1.6ELCOMPACT1.64M5X8.56.57.637175
22000ACURA3.2TLMID-SIZE3.26AS5Z12.27.410.028230
32000ACURA3.5RLMID-SIZE3.56A4Z13.49.211.525264
42000ACURAINTEGRASUBCOMPACT1.84A4X10.07.08.633198
\n", - "
" - ], - "text/plain": [ - " MODEL MAKE MODEL.1 VEHICLE CLASS ENGINE SIZE CYLINDERS TRANSMISSION \\\n", - "0 2000 ACURA 1.6EL COMPACT 1.6 4 A4 \n", - "1 2000 ACURA 1.6EL COMPACT 1.6 4 M5 \n", - "2 2000 ACURA 3.2TL MID-SIZE 3.2 6 AS5 \n", - "3 2000 ACURA 3.5RL MID-SIZE 3.5 6 A4 \n", - "4 2000 ACURA INTEGRA SUBCOMPACT 1.8 4 A4 \n", - "\n", - " FUEL FUEL CONSUMPTION Unnamed: 9 Unnamed: 10 Unnamed: 11 CO2 EMISSIONS \n", - "0 X 9.2 6.7 8.1 35 186 \n", - "1 X 8.5 6.5 7.6 37 175 \n", - "2 Z 12.2 7.4 10.0 28 230 \n", - "3 Z 13.4 9.2 11.5 25 264 \n", - "4 X 10.0 7.0 8.6 33 198 " - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df = pd.read_csv(\"fuel consumption dataset\\Original MY2000-2014 Fuel Consumption Ratings (2-cycle).csv\")\n", - "# take a look at the dataset\n", - "df.head()" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "Index(['MODEL', 'MAKE', 'MODEL.1', 'VEHICLE CLASS', 'ENGINE SIZE', 'CYLINDERS',\n", - " 'TRANSMISSION', 'FUEL', 'FUEL CONSUMPTION', 'Unnamed: 9', 'Unnamed: 10',\n", - " 'Unnamed: 11', 'CO2 EMISSIONS'],\n", - " dtype='object')" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df.columns" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
MODELENGINE SIZECYLINDERSFUEL CONSUMPTIONUnnamed: 9Unnamed: 10Unnamed: 11CO2 EMISSIONS
count14339.00000014339.00000014339.00000014339.00000014339.00000014339.00000014339.00000014339.000000
mean2007.6213823.4746085.98960912.9163478.81678611.07313627.346189248.566357
std4.1396291.3109351.7762143.5480032.3435512.9755667.49208759.113973
min2000.0000000.8000002.0000003.5000003.2000003.60000011.00000083.000000
25%2004.0000002.4000004.00000010.6000007.2000009.10000022.000000209.000000
50%2008.0000003.4000006.00000012.4000008.30000010.50000027.000000239.000000
75%2011.0000004.3000008.00000014.90000010.20000012.80000031.000000285.000000
max2014.0000008.40000016.00000030.60000019.00000024.80000078.000000570.000000
\n", - "
" - ], - "text/plain": [ - " MODEL ENGINE SIZE CYLINDERS FUEL CONSUMPTION \\\n", - "count 14339.000000 14339.000000 14339.000000 14339.000000 \n", - "mean 2007.621382 3.474608 5.989609 12.916347 \n", - "std 4.139629 1.310935 1.776214 3.548003 \n", - "min 2000.000000 0.800000 2.000000 3.500000 \n", - "25% 2004.000000 2.400000 4.000000 10.600000 \n", - "50% 2008.000000 3.400000 6.000000 12.400000 \n", - "75% 2011.000000 4.300000 8.000000 14.900000 \n", - "max 2014.000000 8.400000 16.000000 30.600000 \n", - "\n", - " Unnamed: 9 Unnamed: 10 Unnamed: 11 CO2 EMISSIONS \n", - "count 14339.000000 14339.000000 14339.000000 14339.000000 \n", - "mean 8.816786 11.073136 27.346189 248.566357 \n", - "std 2.343551 2.975566 7.492087 59.113973 \n", - "min 3.200000 3.600000 11.000000 83.000000 \n", - "25% 7.200000 9.100000 22.000000 209.000000 \n", - "50% 8.300000 10.500000 27.000000 239.000000 \n", - "75% 10.200000 12.800000 31.000000 285.000000 \n", - "max 19.000000 24.800000 78.000000 570.000000 " - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df.describe()" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
yearvclassco2
02000COMPACT175
12000MID-SIZE230
22000MID-SIZE264
32000SUBCOMPACT198
42000SUBCOMPACT189
52000SUBCOMPACT191
62000SUBCOMPACT267
72000SUBCOMPACT269
82000COMPACT218
92000COMPACT193
102000COMPACT248
112000COMPACT225
122000COMPACT232
132000COMPACT214
142000COMPACT255
152000COMPACT251
162000MID-SIZE258
172000STATION WAGON - MID-SIZE269
182000MID-SIZE264
192000MID-SIZE267
202000MID-SIZE269
212000MID-SIZE260
222000MID-SIZE269
232000MID-SIZE269
242000COMPACT264
252000COMPACT267
262000MINICOMPACT225
272000MINICOMPACT225
282000TWO-SEATER214
292000TWO-SEATER225
............
143082014COMPACT177
143092014COMPACT177
143102014COMPACT182
143112014COMPACT157
143122014COMPACT157
143132014COMPACT101
143142014MID-SIZE168
143152014MID-SIZE168
143162014MID-SIZE191
143172014MID-SIZE196
143182014MID-SIZE216
143192014MID-SIZE162
143202014MID-SIZE154
143212014MINIVAN242
143222014SUV - SMALL214
143232014SUV - SMALL232
143242014SUV - SMALL214
143252014SUV - STANDARD246
143262014SUV - STANDARD243
143272014COMPACT193
143282014COMPACT202
143292014COMPACT230
143302014MID-SIZE205
143312014MID-SIZE230
143322014SUV - SMALL223
143332014SUV - SMALL237
143342014SUV - SMALL230
143352014SUV - SMALL237
143362014SUV - SMALL225
143372014SUV - STANDARD258
\n", - "

14338 rows × 3 columns

\n", - "
" - ], - "text/plain": [ - " year vclass co2\n", - "0 2000 COMPACT 175\n", - "1 2000 MID-SIZE 230\n", - "2 2000 MID-SIZE 264\n", - "3 2000 SUBCOMPACT 198\n", - "4 2000 SUBCOMPACT 189\n", - "5 2000 SUBCOMPACT 191\n", - "6 2000 SUBCOMPACT 267\n", - "7 2000 SUBCOMPACT 269\n", - "8 2000 COMPACT 218\n", - "9 2000 COMPACT 193\n", - "10 2000 COMPACT 248\n", - "11 2000 COMPACT 225\n", - "12 2000 COMPACT 232\n", - "13 2000 COMPACT 214\n", - "14 2000 COMPACT 255\n", - "15 2000 COMPACT 251\n", - "16 2000 MID-SIZE 258\n", - "17 2000 STATION WAGON - MID-SIZE 269\n", - "18 2000 MID-SIZE 264\n", - "19 2000 MID-SIZE 267\n", - "20 2000 MID-SIZE 269\n", - "21 2000 MID-SIZE 260\n", - "22 2000 MID-SIZE 269\n", - "23 2000 MID-SIZE 269\n", - "24 2000 COMPACT 264\n", - "25 2000 COMPACT 267\n", - "26 2000 MINICOMPACT 225\n", - "27 2000 MINICOMPACT 225\n", - "28 2000 TWO-SEATER 214\n", - "29 2000 TWO-SEATER 225\n", - "... ... ... ...\n", - "14308 2014 COMPACT 177\n", - "14309 2014 COMPACT 177\n", - "14310 2014 COMPACT 182\n", - "14311 2014 COMPACT 157\n", - "14312 2014 COMPACT 157\n", - "14313 2014 COMPACT 101\n", - "14314 2014 MID-SIZE 168\n", - "14315 2014 MID-SIZE 168\n", - "14316 2014 MID-SIZE 191\n", - "14317 2014 MID-SIZE 196\n", - "14318 2014 MID-SIZE 216\n", - "14319 2014 MID-SIZE 162\n", - "14320 2014 MID-SIZE 154\n", - "14321 2014 MINIVAN 242\n", - "14322 2014 SUV - SMALL 214\n", - "14323 2014 SUV - SMALL 232\n", - "14324 2014 SUV - SMALL 214\n", - "14325 2014 SUV - STANDARD 246\n", - "14326 2014 SUV - STANDARD 243\n", - "14327 2014 COMPACT 193\n", - "14328 2014 COMPACT 202\n", - "14329 2014 COMPACT 230\n", - "14330 2014 MID-SIZE 205\n", - "14331 2014 MID-SIZE 230\n", - "14332 2014 SUV - SMALL 223\n", - "14333 2014 SUV - SMALL 237\n", - "14334 2014 SUV - SMALL 230\n", - "14335 2014 SUV - SMALL 237\n", - "14336 2014 SUV - SMALL 225\n", - "14337 2014 SUV - STANDARD 258\n", - "\n", - "[14338 rows x 3 columns]" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cols = ['MODEL','VEHICLE CLASS', 'CO2 EMISSIONS']\n", - "df=df[cols]\n", - "newcols = {\n", - " 'MODEL': 'year', \n", - " 'VEHICLE CLASS':'vclass', \n", - " 'CO2 EMISSIONS':'co2'}\n", - "df.rename(columns=newcols, inplace=True)\n", - "df=df.drop(df.index[0])\n", - "df = df.reset_index(drop=True)\n", - "df" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
yearco2
count14338.00000014338.000000
mean2007.621914248.570721
std4.13948859.113725
min2000.00000083.000000
25%2004.000000209.000000
50%2008.000000239.000000
75%2011.000000285.000000
max2014.000000570.000000
\n", - "
" - ], - "text/plain": [ - " year co2\n", - "count 14338.000000 14338.000000\n", - "mean 2007.621914 248.570721\n", - "std 4.139488 59.113725\n", - "min 2000.000000 83.000000\n", - "25% 2004.000000 209.000000\n", - "50% 2008.000000 239.000000\n", - "75% 2011.000000 285.000000\n", - "max 2014.000000 570.000000" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df['co2'] = df['co2'].astype(float)\n", - "df['vclass']=df['vclass'].astype(str)\n", - "df['year'] = df['year'].astype(int)\n", - "df.describe()" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
yearvclassco2
020003175.0
120002230.0
220002264.0
320001198.0
420001189.0
520001191.0
620001267.0
720001269.0
820003218.0
920003193.0
1020003248.0
1120003225.0
1220003232.0
1320003214.0
1420003255.0
1520003251.0
1620002258.0
1720002264.0
1820002267.0
1920002269.0
2020002260.0
2120002269.0
2220002269.0
2320003264.0
2420003267.0
2520004214.0
2620004225.0
2720003258.0
2820003246.0
2920003237.0
............
766320143246.0
766420141189.0
766520146189.0
766620146189.0
766720146162.0
766820146157.0
766920143163.0
767020143161.0
767120143186.0
767220143177.0
767320143177.0
767420143182.0
767520143157.0
767620143157.0
767720143101.0
767820142168.0
767920142168.0
768020142191.0
768120142196.0
768220142216.0
768320142162.0
768420142154.0
768520147246.0
768620147243.0
768720143193.0
768820143202.0
768920143230.0
769020142205.0
769120142230.0
769220147258.0
\n", - "

7693 rows × 3 columns

\n", - "
" - ], - "text/plain": [ - " year vclass co2\n", - "0 2000 3 175.0\n", - "1 2000 2 230.0\n", - "2 2000 2 264.0\n", - "3 2000 1 198.0\n", - "4 2000 1 189.0\n", - "5 2000 1 191.0\n", - "6 2000 1 267.0\n", - "7 2000 1 269.0\n", - "8 2000 3 218.0\n", - "9 2000 3 193.0\n", - "10 2000 3 248.0\n", - "11 2000 3 225.0\n", - "12 2000 3 232.0\n", - "13 2000 3 214.0\n", - "14 2000 3 255.0\n", - "15 2000 3 251.0\n", - "16 2000 2 258.0\n", - "17 2000 2 264.0\n", - "18 2000 2 267.0\n", - "19 2000 2 269.0\n", - "20 2000 2 260.0\n", - "21 2000 2 269.0\n", - "22 2000 2 269.0\n", - "23 2000 3 264.0\n", - "24 2000 3 267.0\n", - "25 2000 4 214.0\n", - "26 2000 4 225.0\n", - "27 2000 3 258.0\n", - "28 2000 3 246.0\n", - "29 2000 3 237.0\n", - "... ... ... ...\n", - "7663 2014 3 246.0\n", - "7664 2014 1 189.0\n", - "7665 2014 6 189.0\n", - "7666 2014 6 189.0\n", - "7667 2014 6 162.0\n", - "7668 2014 6 157.0\n", - "7669 2014 3 163.0\n", - "7670 2014 3 161.0\n", - "7671 2014 3 186.0\n", - "7672 2014 3 177.0\n", - "7673 2014 3 177.0\n", - "7674 2014 3 182.0\n", - "7675 2014 3 157.0\n", - "7676 2014 3 157.0\n", - "7677 2014 3 101.0\n", - "7678 2014 2 168.0\n", - "7679 2014 2 168.0\n", - "7680 2014 2 191.0\n", - "7681 2014 2 196.0\n", - "7682 2014 2 216.0\n", - "7683 2014 2 162.0\n", - "7684 2014 2 154.0\n", - "7685 2014 7 246.0\n", - "7686 2014 7 243.0\n", - "7687 2014 3 193.0\n", - "7688 2014 3 202.0\n", - "7689 2014 3 230.0\n", - "7690 2014 2 205.0\n", - "7691 2014 2 230.0\n", - "7692 2014 7 258.0\n", - "\n", - "[7693 rows x 3 columns]" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df = df.drop( df[ (df.vclass !='SUBCOMPACT' ) & (df.vclass !='MID-SIZE' ) & (df.vclass !='COMPACT' ) & (df.vclass !='TWO-SEATER' ) & (df.vclass !='FULL-SIZE' ) & (df.vclass !='STATION WAGON - SMALL' ) & (df.vclass !='SUV - STANDARD' )].index )\n", - "df.index = range(len(df))\n", - "df['vclass'] = df['vclass'].replace('SUBCOMPACT', '1')\n", - "df['vclass'] = df['vclass'].replace('MID-SIZE', '2')\n", - "df['vclass'] = df['vclass'].replace('COMPACT', '3')\n", - "df['vclass'] = df['vclass'].replace('TWO-SEATER', '4')\n", - "df['vclass'] = df['vclass'].replace('FULL-SIZE', '5')\n", - "df['vclass'] = df['vclass'].replace('STATION WAGON - SMALL', '6')\n", - "df['vclass'] = df['vclass'].replace('SUV - STANDARD', '7')\n", - "df['vclass'] = df['vclass'].astype(int)\n", - "df\n" - ] - }, - { - "cell_type": "code", - "execution_count": 28, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "Intercept 3214.660155\n", - "vclass 4.951835\n", - "year -1.495280\n", - "dtype: float64" - ] - }, - "execution_count": 28, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "model = smf.ols(formula='co2 ~ vclass + year', data=df).fit()\n", - "model.paramslm = smf.ols(formula='co2 ~ vclass + year', data=df).fit()\n", - "model.params #parameters" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "
OLS Regression Results
Dep. Variable: co2 R-squared: 0.029
Model: OLS Adj. R-squared: 0.028
Method: Least Squares F-statistic: 113.0
Date: Sat, 08 Jul 2017 Prob (F-statistic): 4.30e-49
Time: 19:21:09 Log-Likelihood: -41746.
No. Observations: 7693 AIC: 8.350e+04
Df Residuals: 7690 BIC: 8.352e+04
Df Model: 2
Covariance Type: nonrobust
\n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "
coef std err t P>|t| [95.0% Conf. Int.]
Intercept 3214.6602 300.499 10.698 0.000 2625.601 3803.720
vclass 4.9518 0.391 12.654 0.000 4.185 5.719
year -1.4953 0.150 -9.985 0.000 -1.789 -1.202
\n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "
Omnibus: 1590.732 Durbin-Watson: 0.587
Prob(Omnibus): 0.000 Jarque-Bera (JB): 3807.756
Skew: 1.152 Prob(JB): 0.00
Kurtosis: 5.563 Cond. No. 9.62e+05
" - ], - "text/plain": [ - "\n", - "\"\"\"\n", - " OLS Regression Results \n", - "==============================================================================\n", - "Dep. Variable: co2 R-squared: 0.029\n", - "Model: OLS Adj. R-squared: 0.028\n", - "Method: Least Squares F-statistic: 113.0\n", - "Date: Sat, 08 Jul 2017 Prob (F-statistic): 4.30e-49\n", - "Time: 19:21:09 Log-Likelihood: -41746.\n", - "No. Observations: 7693 AIC: 8.350e+04\n", - "Df Residuals: 7690 BIC: 8.352e+04\n", - "Df Model: 2 \n", - "Covariance Type: nonrobust \n", - "==============================================================================\n", - " coef std err t P>|t| [95.0% Conf. Int.]\n", - "------------------------------------------------------------------------------\n", - "Intercept 3214.6602 300.499 10.698 0.000 2625.601 3803.720\n", - "vclass 4.9518 0.391 12.654 0.000 4.185 5.719\n", - "year -1.4953 0.150 -9.985 0.000 -1.789 -1.202\n", - "==============================================================================\n", - "Omnibus: 1590.732 Durbin-Watson: 0.587\n", - "Prob(Omnibus): 0.000 Jarque-Bera (JB): 3807.756\n", - "Skew: 1.152 Prob(JB): 0.00\n", - "Kurtosis: 5.563 Cond. No. 9.62e+05\n", - "==============================================================================\n", - "\n", - "Warnings:\n", - "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n", - "[2] The condition number is large, 9.62e+05. This might indicate that there are\n", - "strong multicollinearity or other numerical problems.\n", - "\"\"\"" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "model.summary()" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
vclassyear
062000
\n", - "
" - ], - "text/plain": [ - " vclass year\n", - "0 6 2000" - ] - }, - "execution_count": 16, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "toPredict = pd.DataFrame({'vclass': [6], 'year':[2000]})\n", - "toPredict.head()" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "array([ 253.81176846])" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "prediction=model.predict(toPredict)\n", - "prediction" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "So now what we have is basically a cleaned dataset for electric vehicles and the approximate difference in the CO2 that is emitted by a normal vehicle and the CO2 emitted by an electric car (which is nothing)\n", - "\n", - "so the basic flow structure is\n", - "1. Get the source and destination from the user - source GPS destination and destination user entered\n", - "2. Get details of the vehicle - make, model and distance until recharge necessary/ current battery level\n", - "3. Get the rest of the details from the database/dataframe (year, vehicle class, range, consumption, recharge time)\n", - "4. Use the vehicle class and year to predict the amount of CO2 a car using fuel would consume\n", - "5. Use the algorithm to check the time and fuel requirements" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Algorithm:\n", - "inputs: \n", - " 1. Given by user: make model currentDistance\n", - " 2. Extracted from database: year vehicle class range consumption recharge time\n", - "outputs: The difference in CO2 emitted in kilograms, recharge time) and consumption of fuel\n", - "\n", - "Procedure:\n", - "1. get inputs from user\n", - "2. catculate distance between source and destination\n", - "3. check if the distance is greater than current distance that can be viewed on the dashboard of electric vehicles\n", - "4. if it is less than, there is no issue and the journey can be completed safely\n", - "4. if it is greater than find total distance it can travel with a leeway of 10miles (16 km) by taking total distance-(currentdistance-16)=total charge required\n", - " therefore, total time required to charge=recharge time/range * (total charge required) \n", - "5. give time taken for recharge and the fuel consumption in KW/hr and le\n", - "6. get values of vehicle class and year from the db and use it to query how much of CO2 would have been consumed by a car that runs on fuel \n", - "7. display the results to the user" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Example:\n", - "\n", - " source: Chelan, Saskatchewan, Canada\n", - "\n", - " destination: Maymont, Saskatchewan, Canada\n", - " \n", - " distance: 353 km\n", - " \n", - " make: TESLA \t\n", - " \n", - " model: MODEL S P100D\n", - " \n", - " curent distance: 150 km" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
yearmakemodelvclassfuelcityElechwyEleccombEleccityGashwyGascombGasco2co2RatesmogRatedistrecharge
562016TESLAMODEL S P100DFULL-SIZEB22.62021.52.52.32.4010n/a50712
\n", - "
" - ], - "text/plain": [ - " year make model vclass fuel cityElec hwyElec combElec \\\n", - "56 2016 TESLA MODEL S P100D FULL-SIZE B 22.6 20 21.5 \n", - "\n", - " cityGas hwyGas combGas co2 co2Rate smogRate dist recharge \n", - "56 2.5 2.3 2.4 0 10 n/a 507 12 " - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "make=\"TESLA\"\n", - "model=\"MODEL S P100D\"\n", - "distance=353\n", - "curdist=150\n", - "res=elec.loc[(elec['make'] == make) & (elec['model'] == model)]\n", - "res" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "56 507\n", - "Name: dist, dtype: int32" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "maxdist=res['dist'].astype('int')\n", - "maxdist" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "56 12\n", - "Name: recharge, dtype: int32" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "recharge=res['recharge'].astype('int')\n", - "recharge" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "56 2016\n", - "Name: year, dtype: int32" - ] - }, - "execution_count": 21, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "year=res['year'].astype('int')\n", - "year" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\Saumya Suvarna\\Anaconda3\\lib\\site-packages\\ipykernel\\__main__.py:1: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " if __name__ == '__main__':\n", - "C:\\Users\\Saumya Suvarna\\Anaconda3\\lib\\site-packages\\ipykernel\\__main__.py:2: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " from ipykernel import kernelapp as app\n", - "C:\\Users\\Saumya Suvarna\\Anaconda3\\lib\\site-packages\\ipykernel\\__main__.py:3: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " app.launch_new_instance()\n", - "C:\\Users\\Saumya Suvarna\\Anaconda3\\lib\\site-packages\\ipykernel\\__main__.py:4: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - "C:\\Users\\Saumya Suvarna\\Anaconda3\\lib\\site-packages\\ipykernel\\__main__.py:5: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - "C:\\Users\\Saumya Suvarna\\Anaconda3\\lib\\site-packages\\ipykernel\\__main__.py:6: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - "C:\\Users\\Saumya Suvarna\\Anaconda3\\lib\\site-packages\\ipykernel\\__main__.py:7: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n" - ] - }, - { - "data": { - "text/plain": [ - "56 5\n", - "Name: vclass, dtype: int32" - ] - }, - "execution_count": 22, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "res['vclass'] = res['vclass'].replace('SUBCOMPACT', '1')\n", - "res['vclass'] = res['vclass'].replace('MID-SIZE', '2')\n", - "res['vclass'] = res['vclass'].replace('COMPACT', '3')\n", - "res['vclass'] = res['vclass'].replace('TWO-SEATER', '4')\n", - "res['vclass'] = res['vclass'].replace('FULL-SIZE', '5')\n", - "res['vclass'] = res['vclass'].replace('STATION WAGON - SMALL', '6')\n", - "res['vclass'] = res['vclass'].replace('SUV - STANDARD', '7')\n", - "vclass = res['vclass'].astype(int)\n", - "vclass" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "56 2.4\n", - "Name: combGas, dtype: float64" - ] - }, - "execution_count": 23, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "combGas=res['combGas'].astype('float')\n", - "combGas" - ] - }, - { - "cell_type": "code", - "execution_count": 24, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "56 21.5\n", - "Name: combElec, dtype: float64" - ] - }, - "execution_count": 24, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "combElec=res['combElec'].astype('float')\n", - "combElec" - ] - }, - { - "cell_type": "code", - "execution_count": 25, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "56 5.183432\n", - "dtype: float64" - ] - }, - "execution_count": 25, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "if (curdist>distance):\n", - " rechargedist=0\n", - " rechargetime=0;\n", - " flag=0\n", - "else:\n", - " rechargedist=distance-(curdist-16)\n", - " rechargetime=recharge/maxdist*(rechargedist)\n", - " flag=1\n", - " \n", - "rechargetime" - ] - }, - { - "cell_type": "code", - "execution_count": 26, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
vclassyear
5652016
\n", - "
" - ], - "text/plain": [ - " vclass year\n", - "56 5 2016" - ] - }, - "execution_count": 26, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "toPredict = pd.DataFrame({'vclass': vclass, 'year':year})\n", - "toPredict.head()" - ] - }, - { - "cell_type": "code", - "execution_count": 29, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "array([ 224.93545828])" - ] - }, - "execution_count": 29, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "prediction=model.predict(toPredict)\n", - "prediction #shows co2 emitted in grams per km" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "co2=prediction*distance/1000 #in kg\n", - "co2" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "fuelconsgas=combGas/100*distance\n", - "fuelconsgas" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "fuelconselec=combElec/100*distance\n", - "fuelconselec" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "print(\"The time you need to reacharge your car to make your journey is %f \"%rechargetime)\n", - "print(\"The fuel reqired for the journey is %f KWH and in Le is %f\"%(fuelconselec,fuelconsgas))\n", - "print(\"Woo hoo you have saved %f kg of CO2 from destroying our earth.\"%co2)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import matplotlib.pyplot as plt\n", - "import numpy as np\n", - "dist=0\n", - "curdist=150\n", - "x=list()\n", - "y=list()\n", - "maxdist=507\n", - "recharge=12\n", - "while dist <1000:\n", - " \n", - " x.append(dist)\n", - " if (curdist>dist):\n", - " rechargetime=0\n", - " else:\n", - " #if(dist\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
yearmakemodelvclassfuelcityElechwyEleccombEleccityGashwyGascombGasco2co2RatesmogRatedistrechargeco2saved
\n", - "" - ], - "text/plain": [ - "Empty DataFrame\n", - "Columns: [year, make, model, vclass, fuel, cityElec, hwyElec, combElec, cityGas, hwyGas, combGas, co2, co2Rate, smogRate, dist, recharge, co2saved]\n", - "Index: []" - ] - }, - "execution_count": 50, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cols=['year','make','model','vclass','fuel','cityElec','hwyElec','combElec','cityGas','hwyGas','combGas','co2','co2Rate','smogRate','dist','recharge','co2saved']\n", - "db = pd.DataFrame(columns=cols)\n", - "db" - ] - }, - { - "cell_type": "code", - "execution_count": 51, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
cityEleccityGasco2co2Rateco2savedcombEleccombGasdistfuelhwyElechwyGasmakemodelrechargesmogRatevclassyear
016.91.90n/a211.10923718.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02012.0
019.32.20n/a216.06107221.12.4117B232.6NISSANLEAF7n/a2.02012.0
0192.10n/a219.517627202.2122B21.12.4FORDFOCUS ELECTRIC4n/a3.02013.0
016.91.90n/a209.61395718.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02013.0
019.32.20n/a214.56579221.12.4117B232.6NISSANLEAF7n/a2.02013.0
017.21.90n/a224.46946219.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE CABRIOLET8n/a4.02013.0
017.21.90n/a224.46946219.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE COUPE8n/a4.02013.0
022.42.50n/a229.42129722.22.5224B21.92.5TESLAMODEL S (40 kWh battery)6n/a5.02013.0
022.22.50n/a229.42129721.92.5335B21.72.4TESLAMODEL S (60 kWh battery)10n/a5.02013.0
023.82.70n/a229.42129723.62.6426B23.22.6TESLAMODEL S (85 kWh battery)12n/a5.02013.0
023.92.70n/a229.42129723.62.6426B23.22.6TESLAMODEL S PERFORMANCE12n/a5.02013.0
0161.80n/a208.11867817.82131B19.62.2CHEVROLETSPARK EV7n/a1.02014.0
0192.10n/a218.022348202.2122B21.12.4FORDFOCUS ELECTRIC4n/a3.02014.0
016.91.90n/a208.11867818.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02014.0
016.51.90n/a213.07051318.42.1135B20.82.3NISSANLEAF5n/a2.02014.0
017.21.90n/a222.97418319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE CABRIOLET8n/a4.02014.0
017.21.90n/a222.97418319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE COUPE8n/a4.02014.0
022.22.50n/a227.92601821.92.5335B21.72.4TESLAMODEL S (60 kWh battery)10n/a5.02014.0
023.82.70n/a227.92601823.62.6426B23.22.6TESLAMODEL S (85 kWh battery)12n/a5.02014.0
023.92.70n/a227.92601823.62.6426B23.22.6TESLAMODEL S PERFORMANCE12n/a5.02014.0
015.21.70n/a206.62339816.81.9130B18.82.1BMWi34n/a1.02015.0
0161.80n/a206.62339817.82131B19.62.2CHEVROLETSPARK EV7n/a1.02015.0
0192.10n/a216.527068202.2122B21.12.4FORDFOCUS ELECTRIC4n/a3.02015.0
017.520n/a231.38257319.92.2149B22.72.6KIASOUL EV4n/a6.02015.0
016.91.90n/a206.62339818.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02015.0
016.51.90n/a211.57523318.42.1135B20.82.3NISSANLEAF5n/a2.02015.0
017.21.90n/a221.47890319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE CABRIOLET8n/a4.02015.0
017.21.90n/a221.47890319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE COUPE8n/a4.02015.0
022.22.50n/a226.43073821.92.5335B21.72.4TESLAMODEL S (60 kWh battery)10n/a5.02015.0
023.82.70n/a226.43073823.62.6377B23.22.6TESLAMODEL S (70 kWh battery)12n/a5.02015.0
......................................................
023.42.6010224.93545822.52.5407B21.52.4TESLAMODEL S P85D/P90D12n/a5.02016.0
022.92.6010224.93545822.12.5435B212.4TESLAMODEL S P90D (Refresh)12n/a5.02016.0
022.62.5010224.93545821.52.4507B202.3TESLAMODEL S P100D12n/a5.02016.0
0232.6010234.83912822.62.5322B22.22.5TESLAMODEL X 60D10n/a7.02016.0
0232.6010234.83912822.52.5383B21.92.5TESLAMODEL X 75D12n/a7.02016.0
023.22.6010234.83912822.72.6414B22.22.5TESLAMODEL X 90D12n/a7.02016.0
023.62.7010234.83912823.52.6402B23.32.6TESLAMODEL X P90D12n/a7.02016.0
025.72.9010234.83912824.42.7465B22.92.6TESLAMODEL X P100D12n/a7.02016.0
015.21.7010203.63283916.81.9130B18.82.1BMWi3 (60 Ah)4101.02017.0
016.21.8010203.63283917.82183B19.72.2BMWi3 (94 Ah)5101.02017.0
016.41.8010228.39201417.62383B192.1CHEVROLETBOLT EV9.3106.02017.0
017.72010213.53650919.62.2185B21.82.5FORDFOCUS ELECTRIC5.5103.02017.0
017.42010228.39201419.92.2150B232.6KIASOUL EV4106.02017.0
016.91.9010203.63283918.72.1100B20.52.3MITSUBISHIi-MiEV7101.02017.0
0171.9010208.58467418.62.1172B20.72.3NISSANLEAF6102.02017.0
021.52.4010223.44017921.12.4338B20.72.3TESLAMODEL S (60 kWh battery)10105.02017.0
021.52.4010223.44017921.32.4401B212.4TESLAMODEL S (75 kWh battery)12105.02017.0
020.62.3010223.44017920.22.3351B19.62.2TESLAMODEL S 60D10105.02017.0
020.62.3010223.44017920.32.3417B19.92.2TESLAMODEL S 75D12105.02017.0
020.62.3010223.44017920.22.3473B19.72.2TESLAMODEL S 90D12105.02017.0
020.72.3010223.44017920.62.3539B20.52.3TESLAMODEL S 100D12105.02017.0
022.82.6010223.440179222.5435B20.92.3TESLAMODEL S P90D12105.02017.0
022.62.5010223.44017921.52.4507B202.3TESLAMODEL S P100D12105.02017.0
0232.6010233.34384922.62.5322B22.22.5TESLAMODEL X 60D10107.02017.0
0232.6010233.34384922.52.5383B21.92.5TESLAMODEL X 75D12107.02017.0
023.22.6010233.34384922.72.6414B22.22.5TESLAMODEL X 90D12107.02017.0
024.32.7010233.343849242.7475B23.72.7TESLAMODEL X 100D12107.02017.0
023.62.7010233.34384923.52.6402B23.32.6TESLAMODEL X P90D12107.02017.0
025.72.9010233.34384924.42.7465B22.92.6TESLAMODEL X P100D12107.02017.0
016.81.9010213.53650917.42201B18.62.1VOLKSWAGENe-GOLF5.3103.02017.0
\n", - "

83 rows × 17 columns

\n", - "
" - ], - "text/plain": [ - " cityElec cityGas co2 co2Rate co2saved combElec combGas dist fuel \\\n", - "0 16.9 1.9 0 n/a 211.109237 18.7 2.1 100 B \n", - "0 19.3 2.2 0 n/a 216.061072 21.1 2.4 117 B \n", - "0 19 2.1 0 n/a 219.517627 20 2.2 122 B \n", - "0 16.9 1.9 0 n/a 209.613957 18.7 2.1 100 B \n", - "0 19.3 2.2 0 n/a 214.565792 21.1 2.4 117 B \n", - "0 17.2 1.9 0 n/a 224.469462 19.6 2.2 109 B \n", - "0 17.2 1.9 0 n/a 224.469462 19.6 2.2 109 B \n", - "0 22.4 2.5 0 n/a 229.421297 22.2 2.5 224 B \n", - "0 22.2 2.5 0 n/a 229.421297 21.9 2.5 335 B \n", - "0 23.8 2.7 0 n/a 229.421297 23.6 2.6 426 B \n", - "0 23.9 2.7 0 n/a 229.421297 23.6 2.6 426 B \n", - "0 16 1.8 0 n/a 208.118678 17.8 2 131 B \n", - "0 19 2.1 0 n/a 218.022348 20 2.2 122 B \n", - "0 16.9 1.9 0 n/a 208.118678 18.7 2.1 100 B \n", - "0 16.5 1.9 0 n/a 213.070513 18.4 2.1 135 B \n", - "0 17.2 1.9 0 n/a 222.974183 19.6 2.2 109 B \n", - "0 17.2 1.9 0 n/a 222.974183 19.6 2.2 109 B \n", - "0 22.2 2.5 0 n/a 227.926018 21.9 2.5 335 B \n", - "0 23.8 2.7 0 n/a 227.926018 23.6 2.6 426 B \n", - "0 23.9 2.7 0 n/a 227.926018 23.6 2.6 426 B \n", - "0 15.2 1.7 0 n/a 206.623398 16.8 1.9 130 B \n", - "0 16 1.8 0 n/a 206.623398 17.8 2 131 B \n", - "0 19 2.1 0 n/a 216.527068 20 2.2 122 B \n", - "0 17.5 2 0 n/a 231.382573 19.9 2.2 149 B \n", - "0 16.9 1.9 0 n/a 206.623398 18.7 2.1 100 B \n", - "0 16.5 1.9 0 n/a 211.575233 18.4 2.1 135 B \n", - "0 17.2 1.9 0 n/a 221.478903 19.6 2.2 109 B \n", - "0 17.2 1.9 0 n/a 221.478903 19.6 2.2 109 B \n", - "0 22.2 2.5 0 n/a 226.430738 21.9 2.5 335 B \n", - "0 23.8 2.7 0 n/a 226.430738 23.6 2.6 377 B \n", - ".. ... ... .. ... ... ... ... ... ... \n", - "0 23.4 2.6 0 10 224.935458 22.5 2.5 407 B \n", - "0 22.9 2.6 0 10 224.935458 22.1 2.5 435 B \n", - "0 22.6 2.5 0 10 224.935458 21.5 2.4 507 B \n", - "0 23 2.6 0 10 234.839128 22.6 2.5 322 B \n", - "0 23 2.6 0 10 234.839128 22.5 2.5 383 B \n", - "0 23.2 2.6 0 10 234.839128 22.7 2.6 414 B \n", - "0 23.6 2.7 0 10 234.839128 23.5 2.6 402 B \n", - "0 25.7 2.9 0 10 234.839128 24.4 2.7 465 B \n", - "0 15.2 1.7 0 10 203.632839 16.8 1.9 130 B \n", - "0 16.2 1.8 0 10 203.632839 17.8 2 183 B \n", - "0 16.4 1.8 0 10 228.392014 17.6 2 383 B \n", - "0 17.7 2 0 10 213.536509 19.6 2.2 185 B \n", - "0 17.4 2 0 10 228.392014 19.9 2.2 150 B \n", - "0 16.9 1.9 0 10 203.632839 18.7 2.1 100 B \n", - "0 17 1.9 0 10 208.584674 18.6 2.1 172 B \n", - "0 21.5 2.4 0 10 223.440179 21.1 2.4 338 B \n", - "0 21.5 2.4 0 10 223.440179 21.3 2.4 401 B \n", - "0 20.6 2.3 0 10 223.440179 20.2 2.3 351 B \n", - "0 20.6 2.3 0 10 223.440179 20.3 2.3 417 B \n", - "0 20.6 2.3 0 10 223.440179 20.2 2.3 473 B \n", - "0 20.7 2.3 0 10 223.440179 20.6 2.3 539 B \n", - "0 22.8 2.6 0 10 223.440179 22 2.5 435 B \n", - "0 22.6 2.5 0 10 223.440179 21.5 2.4 507 B \n", - "0 23 2.6 0 10 233.343849 22.6 2.5 322 B \n", - "0 23 2.6 0 10 233.343849 22.5 2.5 383 B \n", - "0 23.2 2.6 0 10 233.343849 22.7 2.6 414 B \n", - "0 24.3 2.7 0 10 233.343849 24 2.7 475 B \n", - "0 23.6 2.7 0 10 233.343849 23.5 2.6 402 B \n", - "0 25.7 2.9 0 10 233.343849 24.4 2.7 465 B \n", - "0 16.8 1.9 0 10 213.536509 17.4 2 201 B \n", - "\n", - " hwyElec hwyGas make model recharge \\\n", - "0 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "0 23 2.6 NISSAN LEAF 7 \n", - "0 21.1 2.4 FORD FOCUS ELECTRIC 4 \n", - "0 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "0 23 2.6 NISSAN LEAF 7 \n", - "0 22.5 2.5 SMART FORTWO ELECTRIC DRIVE CABRIOLET 8 \n", - "0 22.5 2.5 SMART FORTWO ELECTRIC DRIVE COUPE 8 \n", - "0 21.9 2.5 TESLA MODEL S (40 kWh battery) 6 \n", - "0 21.7 2.4 TESLA MODEL S (60 kWh battery) 10 \n", - "0 23.2 2.6 TESLA MODEL S (85 kWh battery) 12 \n", - "0 23.2 2.6 TESLA MODEL S PERFORMANCE 12 \n", - "0 19.6 2.2 CHEVROLET SPARK EV 7 \n", - "0 21.1 2.4 FORD FOCUS ELECTRIC 4 \n", - "0 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "0 20.8 2.3 NISSAN LEAF 5 \n", - "0 22.5 2.5 SMART FORTWO ELECTRIC DRIVE CABRIOLET 8 \n", - "0 22.5 2.5 SMART FORTWO ELECTRIC DRIVE COUPE 8 \n", - "0 21.7 2.4 TESLA MODEL S (60 kWh battery) 10 \n", - "0 23.2 2.6 TESLA MODEL S (85 kWh battery) 12 \n", - "0 23.2 2.6 TESLA MODEL S PERFORMANCE 12 \n", - "0 18.8 2.1 BMW i3 4 \n", - "0 19.6 2.2 CHEVROLET SPARK EV 7 \n", - "0 21.1 2.4 FORD FOCUS ELECTRIC 4 \n", - "0 22.7 2.6 KIA SOUL EV 4 \n", - "0 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "0 20.8 2.3 NISSAN LEAF 5 \n", - "0 22.5 2.5 SMART FORTWO ELECTRIC DRIVE CABRIOLET 8 \n", - "0 22.5 2.5 SMART FORTWO ELECTRIC DRIVE COUPE 8 \n", - "0 21.7 2.4 TESLA MODEL S (60 kWh battery) 10 \n", - "0 23.2 2.6 TESLA MODEL S (70 kWh battery) 12 \n", - ".. ... ... ... ... ... \n", - "0 21.5 2.4 TESLA MODEL S P85D/P90D 12 \n", - "0 21 2.4 TESLA MODEL S P90D (Refresh) 12 \n", - "0 20 2.3 TESLA MODEL S P100D 12 \n", - "0 22.2 2.5 TESLA MODEL X 60D 10 \n", - "0 21.9 2.5 TESLA MODEL X 75D 12 \n", - "0 22.2 2.5 TESLA MODEL X 90D 12 \n", - "0 23.3 2.6 TESLA MODEL X P90D 12 \n", - "0 22.9 2.6 TESLA MODEL X P100D 12 \n", - "0 18.8 2.1 BMW i3 (60 Ah) 4 \n", - "0 19.7 2.2 BMW i3 (94 Ah) 5 \n", - "0 19 2.1 CHEVROLET BOLT EV 9.3 \n", - "0 21.8 2.5 FORD FOCUS ELECTRIC 5.5 \n", - "0 23 2.6 KIA SOUL EV 4 \n", - "0 20.5 2.3 MITSUBISHI i-MiEV 7 \n", - "0 20.7 2.3 NISSAN LEAF 6 \n", - "0 20.7 2.3 TESLA MODEL S (60 kWh battery) 10 \n", - "0 21 2.4 TESLA MODEL S (75 kWh battery) 12 \n", - "0 19.6 2.2 TESLA MODEL S 60D 10 \n", - "0 19.9 2.2 TESLA MODEL S 75D 12 \n", - "0 19.7 2.2 TESLA MODEL S 90D 12 \n", - "0 20.5 2.3 TESLA MODEL S 100D 12 \n", - "0 20.9 2.3 TESLA MODEL S P90D 12 \n", - "0 20 2.3 TESLA MODEL S P100D 12 \n", - "0 22.2 2.5 TESLA MODEL X 60D 10 \n", - "0 21.9 2.5 TESLA MODEL X 75D 12 \n", - "0 22.2 2.5 TESLA MODEL X 90D 12 \n", - "0 23.7 2.7 TESLA MODEL X 100D 12 \n", - "0 23.3 2.6 TESLA MODEL X P90D 12 \n", - "0 22.9 2.6 TESLA MODEL X P100D 12 \n", - "0 18.6 2.1 VOLKSWAGEN e-GOLF 5.3 \n", - "\n", - " smogRate vclass year \n", - "0 n/a 1.0 2012.0 \n", - "0 n/a 2.0 2012.0 \n", - "0 n/a 3.0 2013.0 \n", - "0 n/a 1.0 2013.0 \n", - "0 n/a 2.0 2013.0 \n", - "0 n/a 4.0 2013.0 \n", - "0 n/a 4.0 2013.0 \n", - "0 n/a 5.0 2013.0 \n", - "0 n/a 5.0 2013.0 \n", - "0 n/a 5.0 2013.0 \n", - "0 n/a 5.0 2013.0 \n", - "0 n/a 1.0 2014.0 \n", - "0 n/a 3.0 2014.0 \n", - "0 n/a 1.0 2014.0 \n", - "0 n/a 2.0 2014.0 \n", - "0 n/a 4.0 2014.0 \n", - "0 n/a 4.0 2014.0 \n", - "0 n/a 5.0 2014.0 \n", - "0 n/a 5.0 2014.0 \n", - "0 n/a 5.0 2014.0 \n", - "0 n/a 1.0 2015.0 \n", - "0 n/a 1.0 2015.0 \n", - "0 n/a 3.0 2015.0 \n", - "0 n/a 6.0 2015.0 \n", - "0 n/a 1.0 2015.0 \n", - "0 n/a 2.0 2015.0 \n", - "0 n/a 4.0 2015.0 \n", - "0 n/a 4.0 2015.0 \n", - "0 n/a 5.0 2015.0 \n", - "0 n/a 5.0 2015.0 \n", - ".. ... ... ... \n", - "0 n/a 5.0 2016.0 \n", - "0 n/a 5.0 2016.0 \n", - "0 n/a 5.0 2016.0 \n", - "0 n/a 7.0 2016.0 \n", - "0 n/a 7.0 2016.0 \n", - "0 n/a 7.0 2016.0 \n", - "0 n/a 7.0 2016.0 \n", - "0 n/a 7.0 2016.0 \n", - "0 10 1.0 2017.0 \n", - "0 10 1.0 2017.0 \n", - "0 10 6.0 2017.0 \n", - "0 10 3.0 2017.0 \n", - "0 10 6.0 2017.0 \n", - "0 10 1.0 2017.0 \n", - "0 10 2.0 2017.0 \n", - "0 10 5.0 2017.0 \n", - "0 10 5.0 2017.0 \n", - "0 10 5.0 2017.0 \n", - "0 10 5.0 2017.0 \n", - "0 10 5.0 2017.0 \n", - "0 10 5.0 2017.0 \n", - "0 10 5.0 2017.0 \n", - "0 10 5.0 2017.0 \n", - "0 10 7.0 2017.0 \n", - "0 10 7.0 2017.0 \n", - "0 10 7.0 2017.0 \n", - "0 10 7.0 2017.0 \n", - "0 10 7.0 2017.0 \n", - "0 10 7.0 2017.0 \n", - "0 10 3.0 2017.0 \n", - "\n", - "[83 rows x 17 columns]" - ] - }, - "execution_count": 51, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "for index, row in elec.iterrows():\n", - " vclass=row[\"vclass\"]\n", - " if( vclass == 'SUBCOMPACT'):\n", - " vclass=int(1)\n", - " elif(vclass =='MID-SIZE'):\n", - " vclass=int(2)\n", - " elif(vclass =='COMPACT'):\n", - " vclass=int(3)\n", - " elif(vclass =='TWO-SEATER'):\n", - " vclass=int(4)\n", - " elif(vclass =='FULL-SIZE'):\n", - " vclass=int(5)\n", - " elif(vclass =='STATION WAGON - SMALL'):\n", - " vclass=int(6)\n", - " elif(vclass =='SUV - STANDARD'):\n", - " vclass=int(7)\n", - " year=int(row[\"year\"])\n", - " toPredict = pd.DataFrame({'vclass':[vclass], 'year':[year]})\n", - " #print(toPredict.head())\n", - " prediction=model.predict(toPredict)\n", - " #print(prediction)\n", - " dfrow=pd.DataFrame({'year':[year],'make':row[\"make\"],'model':row[\"model\"],'vclass':[vclass],'fuel':row[\"fuel\"],'cityElec':row[\"cityElec\"],'hwyElec':row[\"hwyElec\"],'combElec':row[\"combElec\"],'cityGas':row[\"cityGas\"],'hwyGas':row[\"hwyGas\"],'combGas':row[\"combGas\"],'co2':row[\"co2\"],'co2Rate':row[\"co2Rate\"],'smogRate':row[\"smogRate\"],'dist':row[\"dist\"],'recharge':row[\"recharge\"],'co2saved':prediction})\n", - " db = db.append(dfrow)\n", - "db" - ] - }, - { - "cell_type": "code", - "execution_count": 52, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
cityEleccityGasco2co2Rateco2savedcombEleccombGasdistfuelhwyElechwyGasmakemodelrechargesmogRatevclassyear
016.91.90n/a211.10923718.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02012.0
119.32.20n/a216.06107221.12.4117B232.6NISSANLEAF7n/a2.02012.0
2192.10n/a219.517627202.2122B21.12.4FORDFOCUS ELECTRIC4n/a3.02013.0
316.91.90n/a209.61395718.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02013.0
419.32.20n/a214.56579221.12.4117B232.6NISSANLEAF7n/a2.02013.0
517.21.90n/a224.46946219.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE CABRIOLET8n/a4.02013.0
617.21.90n/a224.46946219.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE COUPE8n/a4.02013.0
722.42.50n/a229.42129722.22.5224B21.92.5TESLAMODEL S (40 kWh battery)6n/a5.02013.0
822.22.50n/a229.42129721.92.5335B21.72.4TESLAMODEL S (60 kWh battery)10n/a5.02013.0
923.82.70n/a229.42129723.62.6426B23.22.6TESLAMODEL S (85 kWh battery)12n/a5.02013.0
1023.92.70n/a229.42129723.62.6426B23.22.6TESLAMODEL S PERFORMANCE12n/a5.02013.0
11161.80n/a208.11867817.82131B19.62.2CHEVROLETSPARK EV7n/a1.02014.0
12192.10n/a218.022348202.2122B21.12.4FORDFOCUS ELECTRIC4n/a3.02014.0
1316.91.90n/a208.11867818.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02014.0
1416.51.90n/a213.07051318.42.1135B20.82.3NISSANLEAF5n/a2.02014.0
1517.21.90n/a222.97418319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE CABRIOLET8n/a4.02014.0
1617.21.90n/a222.97418319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE COUPE8n/a4.02014.0
1722.22.50n/a227.92601821.92.5335B21.72.4TESLAMODEL S (60 kWh battery)10n/a5.02014.0
1823.82.70n/a227.92601823.62.6426B23.22.6TESLAMODEL S (85 kWh battery)12n/a5.02014.0
1923.92.70n/a227.92601823.62.6426B23.22.6TESLAMODEL S PERFORMANCE12n/a5.02014.0
2015.21.70n/a206.62339816.81.9130B18.82.1BMWi34n/a1.02015.0
21161.80n/a206.62339817.82131B19.62.2CHEVROLETSPARK EV7n/a1.02015.0
22192.10n/a216.527068202.2122B21.12.4FORDFOCUS ELECTRIC4n/a3.02015.0
2317.520n/a231.38257319.92.2149B22.72.6KIASOUL EV4n/a6.02015.0
2416.91.90n/a206.62339818.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02015.0
2516.51.90n/a211.57523318.42.1135B20.82.3NISSANLEAF5n/a2.02015.0
2617.21.90n/a221.47890319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE CABRIOLET8n/a4.02015.0
2717.21.90n/a221.47890319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE COUPE8n/a4.02015.0
2822.22.50n/a226.43073821.92.5335B21.72.4TESLAMODEL S (60 kWh battery)10n/a5.02015.0
2923.82.70n/a226.43073823.62.6377B23.22.6TESLAMODEL S (70 kWh battery)12n/a5.02015.0
......................................................
5323.42.6010224.93545822.52.5407B21.52.4TESLAMODEL S P85D/P90D12n/a5.02016.0
5422.92.6010224.93545822.12.5435B212.4TESLAMODEL S P90D (Refresh)12n/a5.02016.0
5522.62.5010224.93545821.52.4507B202.3TESLAMODEL S P100D12n/a5.02016.0
56232.6010234.83912822.62.5322B22.22.5TESLAMODEL X 60D10n/a7.02016.0
57232.6010234.83912822.52.5383B21.92.5TESLAMODEL X 75D12n/a7.02016.0
5823.22.6010234.83912822.72.6414B22.22.5TESLAMODEL X 90D12n/a7.02016.0
5923.62.7010234.83912823.52.6402B23.32.6TESLAMODEL X P90D12n/a7.02016.0
6025.72.9010234.83912824.42.7465B22.92.6TESLAMODEL X P100D12n/a7.02016.0
6115.21.7010203.63283916.81.9130B18.82.1BMWi3 (60 Ah)4101.02017.0
6216.21.8010203.63283917.82183B19.72.2BMWi3 (94 Ah)5101.02017.0
6316.41.8010228.39201417.62383B192.1CHEVROLETBOLT EV9.3106.02017.0
6417.72010213.53650919.62.2185B21.82.5FORDFOCUS ELECTRIC5.5103.02017.0
6517.42010228.39201419.92.2150B232.6KIASOUL EV4106.02017.0
6616.91.9010203.63283918.72.1100B20.52.3MITSUBISHIi-MiEV7101.02017.0
67171.9010208.58467418.62.1172B20.72.3NISSANLEAF6102.02017.0
6821.52.4010223.44017921.12.4338B20.72.3TESLAMODEL S (60 kWh battery)10105.02017.0
6921.52.4010223.44017921.32.4401B212.4TESLAMODEL S (75 kWh battery)12105.02017.0
7020.62.3010223.44017920.22.3351B19.62.2TESLAMODEL S 60D10105.02017.0
7120.62.3010223.44017920.32.3417B19.92.2TESLAMODEL S 75D12105.02017.0
7220.62.3010223.44017920.22.3473B19.72.2TESLAMODEL S 90D12105.02017.0
7320.72.3010223.44017920.62.3539B20.52.3TESLAMODEL S 100D12105.02017.0
7422.82.6010223.440179222.5435B20.92.3TESLAMODEL S P90D12105.02017.0
7522.62.5010223.44017921.52.4507B202.3TESLAMODEL S P100D12105.02017.0
76232.6010233.34384922.62.5322B22.22.5TESLAMODEL X 60D10107.02017.0
77232.6010233.34384922.52.5383B21.92.5TESLAMODEL X 75D12107.02017.0
7823.22.6010233.34384922.72.6414B22.22.5TESLAMODEL X 90D12107.02017.0
7924.32.7010233.343849242.7475B23.72.7TESLAMODEL X 100D12107.02017.0
8023.62.7010233.34384923.52.6402B23.32.6TESLAMODEL X P90D12107.02017.0
8125.72.9010233.34384924.42.7465B22.92.6TESLAMODEL X P100D12107.02017.0
8216.81.9010213.53650917.42201B18.62.1VOLKSWAGENe-GOLF5.3103.02017.0
\n", - "

83 rows × 17 columns

\n", - "
" - ], - "text/plain": [ - " cityElec cityGas co2 co2Rate co2saved combElec combGas dist fuel \\\n", - "0 16.9 1.9 0 n/a 211.109237 18.7 2.1 100 B \n", - "1 19.3 2.2 0 n/a 216.061072 21.1 2.4 117 B \n", - "2 19 2.1 0 n/a 219.517627 20 2.2 122 B \n", - "3 16.9 1.9 0 n/a 209.613957 18.7 2.1 100 B \n", - "4 19.3 2.2 0 n/a 214.565792 21.1 2.4 117 B \n", - "5 17.2 1.9 0 n/a 224.469462 19.6 2.2 109 B \n", - "6 17.2 1.9 0 n/a 224.469462 19.6 2.2 109 B \n", - "7 22.4 2.5 0 n/a 229.421297 22.2 2.5 224 B \n", - "8 22.2 2.5 0 n/a 229.421297 21.9 2.5 335 B \n", - "9 23.8 2.7 0 n/a 229.421297 23.6 2.6 426 B \n", - "10 23.9 2.7 0 n/a 229.421297 23.6 2.6 426 B \n", - "11 16 1.8 0 n/a 208.118678 17.8 2 131 B \n", - "12 19 2.1 0 n/a 218.022348 20 2.2 122 B \n", - "13 16.9 1.9 0 n/a 208.118678 18.7 2.1 100 B \n", - "14 16.5 1.9 0 n/a 213.070513 18.4 2.1 135 B \n", - "15 17.2 1.9 0 n/a 222.974183 19.6 2.2 109 B \n", - "16 17.2 1.9 0 n/a 222.974183 19.6 2.2 109 B \n", - "17 22.2 2.5 0 n/a 227.926018 21.9 2.5 335 B \n", - "18 23.8 2.7 0 n/a 227.926018 23.6 2.6 426 B \n", - "19 23.9 2.7 0 n/a 227.926018 23.6 2.6 426 B \n", - "20 15.2 1.7 0 n/a 206.623398 16.8 1.9 130 B \n", - "21 16 1.8 0 n/a 206.623398 17.8 2 131 B \n", - "22 19 2.1 0 n/a 216.527068 20 2.2 122 B \n", - "23 17.5 2 0 n/a 231.382573 19.9 2.2 149 B \n", - "24 16.9 1.9 0 n/a 206.623398 18.7 2.1 100 B \n", - "25 16.5 1.9 0 n/a 211.575233 18.4 2.1 135 B \n", - "26 17.2 1.9 0 n/a 221.478903 19.6 2.2 109 B \n", - "27 17.2 1.9 0 n/a 221.478903 19.6 2.2 109 B \n", - "28 22.2 2.5 0 n/a 226.430738 21.9 2.5 335 B \n", - "29 23.8 2.7 0 n/a 226.430738 23.6 2.6 377 B \n", - ".. ... ... .. ... ... ... ... ... ... \n", - "53 23.4 2.6 0 10 224.935458 22.5 2.5 407 B \n", - "54 22.9 2.6 0 10 224.935458 22.1 2.5 435 B \n", - "55 22.6 2.5 0 10 224.935458 21.5 2.4 507 B \n", - "56 23 2.6 0 10 234.839128 22.6 2.5 322 B \n", - "57 23 2.6 0 10 234.839128 22.5 2.5 383 B \n", - "58 23.2 2.6 0 10 234.839128 22.7 2.6 414 B \n", - "59 23.6 2.7 0 10 234.839128 23.5 2.6 402 B \n", - "60 25.7 2.9 0 10 234.839128 24.4 2.7 465 B \n", - "61 15.2 1.7 0 10 203.632839 16.8 1.9 130 B \n", - "62 16.2 1.8 0 10 203.632839 17.8 2 183 B \n", - "63 16.4 1.8 0 10 228.392014 17.6 2 383 B \n", - "64 17.7 2 0 10 213.536509 19.6 2.2 185 B \n", - "65 17.4 2 0 10 228.392014 19.9 2.2 150 B \n", - "66 16.9 1.9 0 10 203.632839 18.7 2.1 100 B \n", - "67 17 1.9 0 10 208.584674 18.6 2.1 172 B \n", - "68 21.5 2.4 0 10 223.440179 21.1 2.4 338 B \n", - "69 21.5 2.4 0 10 223.440179 21.3 2.4 401 B \n", - "70 20.6 2.3 0 10 223.440179 20.2 2.3 351 B \n", - "71 20.6 2.3 0 10 223.440179 20.3 2.3 417 B \n", - "72 20.6 2.3 0 10 223.440179 20.2 2.3 473 B \n", - "73 20.7 2.3 0 10 223.440179 20.6 2.3 539 B \n", - "74 22.8 2.6 0 10 223.440179 22 2.5 435 B \n", - "75 22.6 2.5 0 10 223.440179 21.5 2.4 507 B \n", - "76 23 2.6 0 10 233.343849 22.6 2.5 322 B \n", - "77 23 2.6 0 10 233.343849 22.5 2.5 383 B \n", - "78 23.2 2.6 0 10 233.343849 22.7 2.6 414 B \n", - "79 24.3 2.7 0 10 233.343849 24 2.7 475 B \n", - "80 23.6 2.7 0 10 233.343849 23.5 2.6 402 B \n", - "81 25.7 2.9 0 10 233.343849 24.4 2.7 465 B \n", - "82 16.8 1.9 0 10 213.536509 17.4 2 201 B \n", - "\n", - " hwyElec hwyGas make model recharge \\\n", - "0 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "1 23 2.6 NISSAN LEAF 7 \n", - "2 21.1 2.4 FORD FOCUS ELECTRIC 4 \n", - "3 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "4 23 2.6 NISSAN LEAF 7 \n", - "5 22.5 2.5 SMART FORTWO ELECTRIC DRIVE CABRIOLET 8 \n", - "6 22.5 2.5 SMART FORTWO ELECTRIC DRIVE COUPE 8 \n", - "7 21.9 2.5 TESLA MODEL S (40 kWh battery) 6 \n", - "8 21.7 2.4 TESLA MODEL S (60 kWh battery) 10 \n", - "9 23.2 2.6 TESLA MODEL S (85 kWh battery) 12 \n", - "10 23.2 2.6 TESLA MODEL S PERFORMANCE 12 \n", - "11 19.6 2.2 CHEVROLET SPARK EV 7 \n", - "12 21.1 2.4 FORD FOCUS ELECTRIC 4 \n", - "13 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "14 20.8 2.3 NISSAN LEAF 5 \n", - "15 22.5 2.5 SMART FORTWO ELECTRIC DRIVE CABRIOLET 8 \n", - "16 22.5 2.5 SMART FORTWO ELECTRIC DRIVE COUPE 8 \n", - "17 21.7 2.4 TESLA MODEL S (60 kWh battery) 10 \n", - "18 23.2 2.6 TESLA MODEL S (85 kWh battery) 12 \n", - "19 23.2 2.6 TESLA MODEL S PERFORMANCE 12 \n", - "20 18.8 2.1 BMW i3 4 \n", - "21 19.6 2.2 CHEVROLET SPARK EV 7 \n", - "22 21.1 2.4 FORD FOCUS ELECTRIC 4 \n", - "23 22.7 2.6 KIA SOUL EV 4 \n", - "24 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "25 20.8 2.3 NISSAN LEAF 5 \n", - "26 22.5 2.5 SMART FORTWO ELECTRIC DRIVE CABRIOLET 8 \n", - "27 22.5 2.5 SMART FORTWO ELECTRIC DRIVE COUPE 8 \n", - "28 21.7 2.4 TESLA MODEL S (60 kWh battery) 10 \n", - "29 23.2 2.6 TESLA MODEL S (70 kWh battery) 12 \n", - ".. ... ... ... ... ... \n", - "53 21.5 2.4 TESLA MODEL S P85D/P90D 12 \n", - "54 21 2.4 TESLA MODEL S P90D (Refresh) 12 \n", - "55 20 2.3 TESLA MODEL S P100D 12 \n", - "56 22.2 2.5 TESLA MODEL X 60D 10 \n", - "57 21.9 2.5 TESLA MODEL X 75D 12 \n", - "58 22.2 2.5 TESLA MODEL X 90D 12 \n", - "59 23.3 2.6 TESLA MODEL X P90D 12 \n", - "60 22.9 2.6 TESLA MODEL X P100D 12 \n", - "61 18.8 2.1 BMW i3 (60 Ah) 4 \n", - "62 19.7 2.2 BMW i3 (94 Ah) 5 \n", - "63 19 2.1 CHEVROLET BOLT EV 9.3 \n", - "64 21.8 2.5 FORD FOCUS ELECTRIC 5.5 \n", - "65 23 2.6 KIA SOUL EV 4 \n", - "66 20.5 2.3 MITSUBISHI i-MiEV 7 \n", - "67 20.7 2.3 NISSAN LEAF 6 \n", - "68 20.7 2.3 TESLA MODEL S (60 kWh battery) 10 \n", - "69 21 2.4 TESLA MODEL S (75 kWh battery) 12 \n", - "70 19.6 2.2 TESLA MODEL S 60D 10 \n", - "71 19.9 2.2 TESLA MODEL S 75D 12 \n", - "72 19.7 2.2 TESLA MODEL S 90D 12 \n", - "73 20.5 2.3 TESLA MODEL S 100D 12 \n", - "74 20.9 2.3 TESLA MODEL S P90D 12 \n", - "75 20 2.3 TESLA MODEL S P100D 12 \n", - "76 22.2 2.5 TESLA MODEL X 60D 10 \n", - "77 21.9 2.5 TESLA MODEL X 75D 12 \n", - "78 22.2 2.5 TESLA MODEL X 90D 12 \n", - "79 23.7 2.7 TESLA MODEL X 100D 12 \n", - "80 23.3 2.6 TESLA MODEL X P90D 12 \n", - "81 22.9 2.6 TESLA MODEL X P100D 12 \n", - "82 18.6 2.1 VOLKSWAGEN e-GOLF 5.3 \n", - "\n", - " smogRate vclass year \n", - "0 n/a 1.0 2012.0 \n", - "1 n/a 2.0 2012.0 \n", - "2 n/a 3.0 2013.0 \n", - "3 n/a 1.0 2013.0 \n", - "4 n/a 2.0 2013.0 \n", - "5 n/a 4.0 2013.0 \n", - "6 n/a 4.0 2013.0 \n", - "7 n/a 5.0 2013.0 \n", - "8 n/a 5.0 2013.0 \n", - "9 n/a 5.0 2013.0 \n", - "10 n/a 5.0 2013.0 \n", - "11 n/a 1.0 2014.0 \n", - "12 n/a 3.0 2014.0 \n", - "13 n/a 1.0 2014.0 \n", - "14 n/a 2.0 2014.0 \n", - "15 n/a 4.0 2014.0 \n", - "16 n/a 4.0 2014.0 \n", - "17 n/a 5.0 2014.0 \n", - "18 n/a 5.0 2014.0 \n", - "19 n/a 5.0 2014.0 \n", - "20 n/a 1.0 2015.0 \n", - "21 n/a 1.0 2015.0 \n", - "22 n/a 3.0 2015.0 \n", - "23 n/a 6.0 2015.0 \n", - "24 n/a 1.0 2015.0 \n", - "25 n/a 2.0 2015.0 \n", - "26 n/a 4.0 2015.0 \n", - "27 n/a 4.0 2015.0 \n", - "28 n/a 5.0 2015.0 \n", - "29 n/a 5.0 2015.0 \n", - ".. ... ... ... \n", - "53 n/a 5.0 2016.0 \n", - "54 n/a 5.0 2016.0 \n", - "55 n/a 5.0 2016.0 \n", - "56 n/a 7.0 2016.0 \n", - "57 n/a 7.0 2016.0 \n", - "58 n/a 7.0 2016.0 \n", - "59 n/a 7.0 2016.0 \n", - "60 n/a 7.0 2016.0 \n", - "61 10 1.0 2017.0 \n", - "62 10 1.0 2017.0 \n", - "63 10 6.0 2017.0 \n", - "64 10 3.0 2017.0 \n", - "65 10 6.0 2017.0 \n", - "66 10 1.0 2017.0 \n", - "67 10 2.0 2017.0 \n", - "68 10 5.0 2017.0 \n", - "69 10 5.0 2017.0 \n", - "70 10 5.0 2017.0 \n", - "71 10 5.0 2017.0 \n", - "72 10 5.0 2017.0 \n", - "73 10 5.0 2017.0 \n", - "74 10 5.0 2017.0 \n", - "75 10 5.0 2017.0 \n", - "76 10 7.0 2017.0 \n", - "77 10 7.0 2017.0 \n", - "78 10 7.0 2017.0 \n", - "79 10 7.0 2017.0 \n", - "80 10 7.0 2017.0 \n", - "81 10 7.0 2017.0 \n", - "82 10 3.0 2017.0 \n", - "\n", - "[83 rows x 17 columns]" - ] - }, - "execution_count": 52, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "db=db.reset_index(drop=True)\n", - "db" - ] - }, - { - "cell_type": "code", - "execution_count": 53, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "db.to_csv('Database.csv')\n", - "db.to_json('Databasejs.json')" - ] - }, - { - "cell_type": "code", - "execution_count": 56, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
cityEleccityGasco2co2Rateco2savedcombEleccombGasdistfuelhwyElechwyGasmakemodelrechargesmogRatevclassyearvehicle
016.91.90n/a211.10923718.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02012.0MITSUBISHI i-MiEV
119.32.20n/a216.06107221.12.4117B232.6NISSANLEAF7n/a2.02012.0NISSAN LEAF
2192.10n/a219.517627202.2122B21.12.4FORDFOCUS ELECTRIC4n/a3.02013.0FORD FOCUS ELECTRIC
316.91.90n/a209.61395718.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02013.0MITSUBISHI i-MiEV
419.32.20n/a214.56579221.12.4117B232.6NISSANLEAF7n/a2.02013.0NISSAN LEAF
517.21.90n/a224.46946219.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE CABRIOLET8n/a4.02013.0SMART FORTWO ELECTRIC DRIVE CABRIOLET
617.21.90n/a224.46946219.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE COUPE8n/a4.02013.0SMART FORTWO ELECTRIC DRIVE COUPE
722.42.50n/a229.42129722.22.5224B21.92.5TESLAMODEL S (40 kWh battery)6n/a5.02013.0TESLA MODEL S (40 kWh battery)
822.22.50n/a229.42129721.92.5335B21.72.4TESLAMODEL S (60 kWh battery)10n/a5.02013.0TESLA MODEL S (60 kWh battery)
923.82.70n/a229.42129723.62.6426B23.22.6TESLAMODEL S (85 kWh battery)12n/a5.02013.0TESLA MODEL S (85 kWh battery)
1023.92.70n/a229.42129723.62.6426B23.22.6TESLAMODEL S PERFORMANCE12n/a5.02013.0TESLA MODEL S PERFORMANCE
11161.80n/a208.11867817.82131B19.62.2CHEVROLETSPARK EV7n/a1.02014.0CHEVROLET SPARK EV
12192.10n/a218.022348202.2122B21.12.4FORDFOCUS ELECTRIC4n/a3.02014.0FORD FOCUS ELECTRIC
1316.91.90n/a208.11867818.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02014.0MITSUBISHI i-MiEV
1416.51.90n/a213.07051318.42.1135B20.82.3NISSANLEAF5n/a2.02014.0NISSAN LEAF
1517.21.90n/a222.97418319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE CABRIOLET8n/a4.02014.0SMART FORTWO ELECTRIC DRIVE CABRIOLET
1617.21.90n/a222.97418319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE COUPE8n/a4.02014.0SMART FORTWO ELECTRIC DRIVE COUPE
1722.22.50n/a227.92601821.92.5335B21.72.4TESLAMODEL S (60 kWh battery)10n/a5.02014.0TESLA MODEL S (60 kWh battery)
1823.82.70n/a227.92601823.62.6426B23.22.6TESLAMODEL S (85 kWh battery)12n/a5.02014.0TESLA MODEL S (85 kWh battery)
1923.92.70n/a227.92601823.62.6426B23.22.6TESLAMODEL S PERFORMANCE12n/a5.02014.0TESLA MODEL S PERFORMANCE
2015.21.70n/a206.62339816.81.9130B18.82.1BMWi34n/a1.02015.0BMW i3
21161.80n/a206.62339817.82131B19.62.2CHEVROLETSPARK EV7n/a1.02015.0CHEVROLET SPARK EV
22192.10n/a216.527068202.2122B21.12.4FORDFOCUS ELECTRIC4n/a3.02015.0FORD FOCUS ELECTRIC
2317.520n/a231.38257319.92.2149B22.72.6KIASOUL EV4n/a6.02015.0KIA SOUL EV
2416.91.90n/a206.62339818.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02015.0MITSUBISHI i-MiEV
2516.51.90n/a211.57523318.42.1135B20.82.3NISSANLEAF5n/a2.02015.0NISSAN LEAF
2617.21.90n/a221.47890319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE CABRIOLET8n/a4.02015.0SMART FORTWO ELECTRIC DRIVE CABRIOLET
2717.21.90n/a221.47890319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE COUPE8n/a4.02015.0SMART FORTWO ELECTRIC DRIVE COUPE
2822.22.50n/a226.43073821.92.5335B21.72.4TESLAMODEL S (60 kWh battery)10n/a5.02015.0TESLA MODEL S (60 kWh battery)
2923.82.70n/a226.43073823.62.6377B23.22.6TESLAMODEL S (70 kWh battery)12n/a5.02015.0TESLA MODEL S (70 kWh battery)
.........................................................
5323.42.6010224.93545822.52.5407B21.52.4TESLAMODEL S P85D/P90D12n/a5.02016.0TESLA MODEL S P85D/P90D
5422.92.6010224.93545822.12.5435B212.4TESLAMODEL S P90D (Refresh)12n/a5.02016.0TESLA MODEL S P90D (Refresh)
5522.62.5010224.93545821.52.4507B202.3TESLAMODEL S P100D12n/a5.02016.0TESLA MODEL S P100D
56232.6010234.83912822.62.5322B22.22.5TESLAMODEL X 60D10n/a7.02016.0TESLA MODEL X 60D
57232.6010234.83912822.52.5383B21.92.5TESLAMODEL X 75D12n/a7.02016.0TESLA MODEL X 75D
5823.22.6010234.83912822.72.6414B22.22.5TESLAMODEL X 90D12n/a7.02016.0TESLA MODEL X 90D
5923.62.7010234.83912823.52.6402B23.32.6TESLAMODEL X P90D12n/a7.02016.0TESLA MODEL X P90D
6025.72.9010234.83912824.42.7465B22.92.6TESLAMODEL X P100D12n/a7.02016.0TESLA MODEL X P100D
6115.21.7010203.63283916.81.9130B18.82.1BMWi3 (60 Ah)4101.02017.0BMW i3 (60 Ah)
6216.21.8010203.63283917.82183B19.72.2BMWi3 (94 Ah)5101.02017.0BMW i3 (94 Ah)
6316.41.8010228.39201417.62383B192.1CHEVROLETBOLT EV9.3106.02017.0CHEVROLET BOLT EV
6417.72010213.53650919.62.2185B21.82.5FORDFOCUS ELECTRIC5.5103.02017.0FORD FOCUS ELECTRIC
6517.42010228.39201419.92.2150B232.6KIASOUL EV4106.02017.0KIA SOUL EV
6616.91.9010203.63283918.72.1100B20.52.3MITSUBISHIi-MiEV7101.02017.0MITSUBISHI i-MiEV
67171.9010208.58467418.62.1172B20.72.3NISSANLEAF6102.02017.0NISSAN LEAF
6821.52.4010223.44017921.12.4338B20.72.3TESLAMODEL S (60 kWh battery)10105.02017.0TESLA MODEL S (60 kWh battery)
6921.52.4010223.44017921.32.4401B212.4TESLAMODEL S (75 kWh battery)12105.02017.0TESLA MODEL S (75 kWh battery)
7020.62.3010223.44017920.22.3351B19.62.2TESLAMODEL S 60D10105.02017.0TESLA MODEL S 60D
7120.62.3010223.44017920.32.3417B19.92.2TESLAMODEL S 75D12105.02017.0TESLA MODEL S 75D
7220.62.3010223.44017920.22.3473B19.72.2TESLAMODEL S 90D12105.02017.0TESLA MODEL S 90D
7320.72.3010223.44017920.62.3539B20.52.3TESLAMODEL S 100D12105.02017.0TESLA MODEL S 100D
7422.82.6010223.440179222.5435B20.92.3TESLAMODEL S P90D12105.02017.0TESLA MODEL S P90D
7522.62.5010223.44017921.52.4507B202.3TESLAMODEL S P100D12105.02017.0TESLA MODEL S P100D
76232.6010233.34384922.62.5322B22.22.5TESLAMODEL X 60D10107.02017.0TESLA MODEL X 60D
77232.6010233.34384922.52.5383B21.92.5TESLAMODEL X 75D12107.02017.0TESLA MODEL X 75D
7823.22.6010233.34384922.72.6414B22.22.5TESLAMODEL X 90D12107.02017.0TESLA MODEL X 90D
7924.32.7010233.343849242.7475B23.72.7TESLAMODEL X 100D12107.02017.0TESLA MODEL X 100D
8023.62.7010233.34384923.52.6402B23.32.6TESLAMODEL X P90D12107.02017.0TESLA MODEL X P90D
8125.72.9010233.34384924.42.7465B22.92.6TESLAMODEL X P100D12107.02017.0TESLA MODEL X P100D
8216.81.9010213.53650917.42201B18.62.1VOLKSWAGENe-GOLF5.3103.02017.0VOLKSWAGEN e-GOLF
\n", - "

83 rows × 18 columns

\n", - "
" - ], - "text/plain": [ - " cityElec cityGas co2 co2Rate co2saved combElec combGas dist fuel \\\n", - "0 16.9 1.9 0 n/a 211.109237 18.7 2.1 100 B \n", - "1 19.3 2.2 0 n/a 216.061072 21.1 2.4 117 B \n", - "2 19 2.1 0 n/a 219.517627 20 2.2 122 B \n", - "3 16.9 1.9 0 n/a 209.613957 18.7 2.1 100 B \n", - "4 19.3 2.2 0 n/a 214.565792 21.1 2.4 117 B \n", - "5 17.2 1.9 0 n/a 224.469462 19.6 2.2 109 B \n", - "6 17.2 1.9 0 n/a 224.469462 19.6 2.2 109 B \n", - "7 22.4 2.5 0 n/a 229.421297 22.2 2.5 224 B \n", - "8 22.2 2.5 0 n/a 229.421297 21.9 2.5 335 B \n", - "9 23.8 2.7 0 n/a 229.421297 23.6 2.6 426 B \n", - "10 23.9 2.7 0 n/a 229.421297 23.6 2.6 426 B \n", - "11 16 1.8 0 n/a 208.118678 17.8 2 131 B \n", - "12 19 2.1 0 n/a 218.022348 20 2.2 122 B \n", - "13 16.9 1.9 0 n/a 208.118678 18.7 2.1 100 B \n", - "14 16.5 1.9 0 n/a 213.070513 18.4 2.1 135 B \n", - "15 17.2 1.9 0 n/a 222.974183 19.6 2.2 109 B \n", - "16 17.2 1.9 0 n/a 222.974183 19.6 2.2 109 B \n", - "17 22.2 2.5 0 n/a 227.926018 21.9 2.5 335 B \n", - "18 23.8 2.7 0 n/a 227.926018 23.6 2.6 426 B \n", - "19 23.9 2.7 0 n/a 227.926018 23.6 2.6 426 B \n", - "20 15.2 1.7 0 n/a 206.623398 16.8 1.9 130 B \n", - "21 16 1.8 0 n/a 206.623398 17.8 2 131 B \n", - "22 19 2.1 0 n/a 216.527068 20 2.2 122 B \n", - "23 17.5 2 0 n/a 231.382573 19.9 2.2 149 B \n", - "24 16.9 1.9 0 n/a 206.623398 18.7 2.1 100 B \n", - "25 16.5 1.9 0 n/a 211.575233 18.4 2.1 135 B \n", - "26 17.2 1.9 0 n/a 221.478903 19.6 2.2 109 B \n", - "27 17.2 1.9 0 n/a 221.478903 19.6 2.2 109 B \n", - "28 22.2 2.5 0 n/a 226.430738 21.9 2.5 335 B \n", - "29 23.8 2.7 0 n/a 226.430738 23.6 2.6 377 B \n", - ".. ... ... .. ... ... ... ... ... ... \n", - "53 23.4 2.6 0 10 224.935458 22.5 2.5 407 B \n", - "54 22.9 2.6 0 10 224.935458 22.1 2.5 435 B \n", - "55 22.6 2.5 0 10 224.935458 21.5 2.4 507 B \n", - "56 23 2.6 0 10 234.839128 22.6 2.5 322 B \n", - "57 23 2.6 0 10 234.839128 22.5 2.5 383 B \n", - "58 23.2 2.6 0 10 234.839128 22.7 2.6 414 B \n", - "59 23.6 2.7 0 10 234.839128 23.5 2.6 402 B \n", - "60 25.7 2.9 0 10 234.839128 24.4 2.7 465 B \n", - "61 15.2 1.7 0 10 203.632839 16.8 1.9 130 B \n", - "62 16.2 1.8 0 10 203.632839 17.8 2 183 B \n", - "63 16.4 1.8 0 10 228.392014 17.6 2 383 B \n", - "64 17.7 2 0 10 213.536509 19.6 2.2 185 B \n", - "65 17.4 2 0 10 228.392014 19.9 2.2 150 B \n", - "66 16.9 1.9 0 10 203.632839 18.7 2.1 100 B \n", - "67 17 1.9 0 10 208.584674 18.6 2.1 172 B \n", - "68 21.5 2.4 0 10 223.440179 21.1 2.4 338 B \n", - "69 21.5 2.4 0 10 223.440179 21.3 2.4 401 B \n", - "70 20.6 2.3 0 10 223.440179 20.2 2.3 351 B \n", - "71 20.6 2.3 0 10 223.440179 20.3 2.3 417 B \n", - "72 20.6 2.3 0 10 223.440179 20.2 2.3 473 B \n", - "73 20.7 2.3 0 10 223.440179 20.6 2.3 539 B \n", - "74 22.8 2.6 0 10 223.440179 22 2.5 435 B \n", - "75 22.6 2.5 0 10 223.440179 21.5 2.4 507 B \n", - "76 23 2.6 0 10 233.343849 22.6 2.5 322 B \n", - "77 23 2.6 0 10 233.343849 22.5 2.5 383 B \n", - "78 23.2 2.6 0 10 233.343849 22.7 2.6 414 B \n", - "79 24.3 2.7 0 10 233.343849 24 2.7 475 B \n", - "80 23.6 2.7 0 10 233.343849 23.5 2.6 402 B \n", - "81 25.7 2.9 0 10 233.343849 24.4 2.7 465 B \n", - "82 16.8 1.9 0 10 213.536509 17.4 2 201 B \n", - "\n", - " hwyElec hwyGas make model recharge \\\n", - "0 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "1 23 2.6 NISSAN LEAF 7 \n", - "2 21.1 2.4 FORD FOCUS ELECTRIC 4 \n", - "3 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "4 23 2.6 NISSAN LEAF 7 \n", - "5 22.5 2.5 SMART FORTWO ELECTRIC DRIVE CABRIOLET 8 \n", - "6 22.5 2.5 SMART FORTWO ELECTRIC DRIVE COUPE 8 \n", - "7 21.9 2.5 TESLA MODEL S (40 kWh battery) 6 \n", - "8 21.7 2.4 TESLA MODEL S (60 kWh battery) 10 \n", - "9 23.2 2.6 TESLA MODEL S (85 kWh battery) 12 \n", - "10 23.2 2.6 TESLA MODEL S PERFORMANCE 12 \n", - "11 19.6 2.2 CHEVROLET SPARK EV 7 \n", - "12 21.1 2.4 FORD FOCUS ELECTRIC 4 \n", - "13 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "14 20.8 2.3 NISSAN LEAF 5 \n", - "15 22.5 2.5 SMART FORTWO ELECTRIC DRIVE CABRIOLET 8 \n", - "16 22.5 2.5 SMART FORTWO ELECTRIC DRIVE COUPE 8 \n", - "17 21.7 2.4 TESLA MODEL S (60 kWh battery) 10 \n", - "18 23.2 2.6 TESLA MODEL S (85 kWh battery) 12 \n", - "19 23.2 2.6 TESLA MODEL S PERFORMANCE 12 \n", - "20 18.8 2.1 BMW i3 4 \n", - "21 19.6 2.2 CHEVROLET SPARK EV 7 \n", - "22 21.1 2.4 FORD FOCUS ELECTRIC 4 \n", - "23 22.7 2.6 KIA SOUL EV 4 \n", - "24 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "25 20.8 2.3 NISSAN LEAF 5 \n", - "26 22.5 2.5 SMART FORTWO ELECTRIC DRIVE CABRIOLET 8 \n", - "27 22.5 2.5 SMART FORTWO ELECTRIC DRIVE COUPE 8 \n", - "28 21.7 2.4 TESLA MODEL S (60 kWh battery) 10 \n", - "29 23.2 2.6 TESLA MODEL S (70 kWh battery) 12 \n", - ".. ... ... ... ... ... \n", - "53 21.5 2.4 TESLA MODEL S P85D/P90D 12 \n", - "54 21 2.4 TESLA MODEL S P90D (Refresh) 12 \n", - "55 20 2.3 TESLA MODEL S P100D 12 \n", - "56 22.2 2.5 TESLA MODEL X 60D 10 \n", - "57 21.9 2.5 TESLA MODEL X 75D 12 \n", - "58 22.2 2.5 TESLA MODEL X 90D 12 \n", - "59 23.3 2.6 TESLA MODEL X P90D 12 \n", - "60 22.9 2.6 TESLA MODEL X P100D 12 \n", - "61 18.8 2.1 BMW i3 (60 Ah) 4 \n", - "62 19.7 2.2 BMW i3 (94 Ah) 5 \n", - "63 19 2.1 CHEVROLET BOLT EV 9.3 \n", - "64 21.8 2.5 FORD FOCUS ELECTRIC 5.5 \n", - "65 23 2.6 KIA SOUL EV 4 \n", - "66 20.5 2.3 MITSUBISHI i-MiEV 7 \n", - "67 20.7 2.3 NISSAN LEAF 6 \n", - "68 20.7 2.3 TESLA MODEL S (60 kWh battery) 10 \n", - "69 21 2.4 TESLA MODEL S (75 kWh battery) 12 \n", - "70 19.6 2.2 TESLA MODEL S 60D 10 \n", - "71 19.9 2.2 TESLA MODEL S 75D 12 \n", - "72 19.7 2.2 TESLA MODEL S 90D 12 \n", - "73 20.5 2.3 TESLA MODEL S 100D 12 \n", - "74 20.9 2.3 TESLA MODEL S P90D 12 \n", - "75 20 2.3 TESLA MODEL S P100D 12 \n", - "76 22.2 2.5 TESLA MODEL X 60D 10 \n", - "77 21.9 2.5 TESLA MODEL X 75D 12 \n", - "78 22.2 2.5 TESLA MODEL X 90D 12 \n", - "79 23.7 2.7 TESLA MODEL X 100D 12 \n", - "80 23.3 2.6 TESLA MODEL X P90D 12 \n", - "81 22.9 2.6 TESLA MODEL X P100D 12 \n", - "82 18.6 2.1 VOLKSWAGEN e-GOLF 5.3 \n", - "\n", - " smogRate vclass year vehicle \n", - "0 n/a 1.0 2012.0 MITSUBISHI i-MiEV \n", - "1 n/a 2.0 2012.0 NISSAN LEAF \n", - "2 n/a 3.0 2013.0 FORD FOCUS ELECTRIC \n", - "3 n/a 1.0 2013.0 MITSUBISHI i-MiEV \n", - "4 n/a 2.0 2013.0 NISSAN LEAF \n", - "5 n/a 4.0 2013.0 SMART FORTWO ELECTRIC DRIVE CABRIOLET \n", - "6 n/a 4.0 2013.0 SMART FORTWO ELECTRIC DRIVE COUPE \n", - "7 n/a 5.0 2013.0 TESLA MODEL S (40 kWh battery) \n", - "8 n/a 5.0 2013.0 TESLA MODEL S (60 kWh battery) \n", - "9 n/a 5.0 2013.0 TESLA MODEL S (85 kWh battery) \n", - "10 n/a 5.0 2013.0 TESLA MODEL S PERFORMANCE \n", - "11 n/a 1.0 2014.0 CHEVROLET SPARK EV \n", - "12 n/a 3.0 2014.0 FORD FOCUS ELECTRIC \n", - "13 n/a 1.0 2014.0 MITSUBISHI i-MiEV \n", - "14 n/a 2.0 2014.0 NISSAN LEAF \n", - "15 n/a 4.0 2014.0 SMART FORTWO ELECTRIC DRIVE CABRIOLET \n", - "16 n/a 4.0 2014.0 SMART FORTWO ELECTRIC DRIVE COUPE \n", - "17 n/a 5.0 2014.0 TESLA MODEL S (60 kWh battery) \n", - "18 n/a 5.0 2014.0 TESLA MODEL S (85 kWh battery) \n", - "19 n/a 5.0 2014.0 TESLA MODEL S PERFORMANCE \n", - "20 n/a 1.0 2015.0 BMW i3 \n", - "21 n/a 1.0 2015.0 CHEVROLET SPARK EV \n", - "22 n/a 3.0 2015.0 FORD FOCUS ELECTRIC \n", - "23 n/a 6.0 2015.0 KIA SOUL EV \n", - "24 n/a 1.0 2015.0 MITSUBISHI i-MiEV \n", - "25 n/a 2.0 2015.0 NISSAN LEAF \n", - "26 n/a 4.0 2015.0 SMART FORTWO ELECTRIC DRIVE CABRIOLET \n", - "27 n/a 4.0 2015.0 SMART FORTWO ELECTRIC DRIVE COUPE \n", - "28 n/a 5.0 2015.0 TESLA MODEL S (60 kWh battery) \n", - "29 n/a 5.0 2015.0 TESLA MODEL S (70 kWh battery) \n", - ".. ... ... ... ... \n", - "53 n/a 5.0 2016.0 TESLA MODEL S P85D/P90D \n", - "54 n/a 5.0 2016.0 TESLA MODEL S P90D (Refresh) \n", - "55 n/a 5.0 2016.0 TESLA MODEL S P100D \n", - "56 n/a 7.0 2016.0 TESLA MODEL X 60D \n", - "57 n/a 7.0 2016.0 TESLA MODEL X 75D \n", - "58 n/a 7.0 2016.0 TESLA MODEL X 90D \n", - "59 n/a 7.0 2016.0 TESLA MODEL X P90D \n", - "60 n/a 7.0 2016.0 TESLA MODEL X P100D \n", - "61 10 1.0 2017.0 BMW i3 (60 Ah) \n", - "62 10 1.0 2017.0 BMW i3 (94 Ah) \n", - "63 10 6.0 2017.0 CHEVROLET BOLT EV \n", - "64 10 3.0 2017.0 FORD FOCUS ELECTRIC \n", - "65 10 6.0 2017.0 KIA SOUL EV \n", - "66 10 1.0 2017.0 MITSUBISHI i-MiEV \n", - "67 10 2.0 2017.0 NISSAN LEAF \n", - "68 10 5.0 2017.0 TESLA MODEL S (60 kWh battery) \n", - "69 10 5.0 2017.0 TESLA MODEL S (75 kWh battery) \n", - "70 10 5.0 2017.0 TESLA MODEL S 60D \n", - "71 10 5.0 2017.0 TESLA MODEL S 75D \n", - "72 10 5.0 2017.0 TESLA MODEL S 90D \n", - "73 10 5.0 2017.0 TESLA MODEL S 100D \n", - "74 10 5.0 2017.0 TESLA MODEL S P90D \n", - "75 10 5.0 2017.0 TESLA MODEL S P100D \n", - "76 10 7.0 2017.0 TESLA MODEL X 60D \n", - "77 10 7.0 2017.0 TESLA MODEL X 75D \n", - "78 10 7.0 2017.0 TESLA MODEL X 90D \n", - "79 10 7.0 2017.0 TESLA MODEL X 100D \n", - "80 10 7.0 2017.0 TESLA MODEL X P90D \n", - "81 10 7.0 2017.0 TESLA MODEL X P100D \n", - "82 10 3.0 2017.0 VOLKSWAGEN e-GOLF \n", - "\n", - "[83 rows x 18 columns]" - ] - }, - "execution_count": 56, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "db[\"vehicle\"]=db[\"make\"].astype(str) + \" \"+db[\"model\"].astype(str)\n", - "db" - ] - }, - { - "cell_type": "code", - "execution_count": 57, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
cityEleccityGasco2co2Rateco2savedcombEleccombGasdistfuelhwyElechwyGasrechargesmogRatevclassyearvehicle
016.91.90n/a211.10923718.72.1100B21.42.47n/a1.02012.0MITSUBISHI i-MiEV
119.32.20n/a216.06107221.12.4117B232.67n/a2.02012.0NISSAN LEAF
2192.10n/a219.517627202.2122B21.12.44n/a3.02013.0FORD FOCUS ELECTRIC
316.91.90n/a209.61395718.72.1100B21.42.47n/a1.02013.0MITSUBISHI i-MiEV
419.32.20n/a214.56579221.12.4117B232.67n/a2.02013.0NISSAN LEAF
517.21.90n/a224.46946219.62.2109B22.52.58n/a4.02013.0SMART FORTWO ELECTRIC DRIVE CABRIOLET
617.21.90n/a224.46946219.62.2109B22.52.58n/a4.02013.0SMART FORTWO ELECTRIC DRIVE COUPE
722.42.50n/a229.42129722.22.5224B21.92.56n/a5.02013.0TESLA MODEL S (40 kWh battery)
822.22.50n/a229.42129721.92.5335B21.72.410n/a5.02013.0TESLA MODEL S (60 kWh battery)
923.82.70n/a229.42129723.62.6426B23.22.612n/a5.02013.0TESLA MODEL S (85 kWh battery)
1023.92.70n/a229.42129723.62.6426B23.22.612n/a5.02013.0TESLA MODEL S PERFORMANCE
11161.80n/a208.11867817.82131B19.62.27n/a1.02014.0CHEVROLET SPARK EV
12192.10n/a218.022348202.2122B21.12.44n/a3.02014.0FORD FOCUS ELECTRIC
1316.91.90n/a208.11867818.72.1100B21.42.47n/a1.02014.0MITSUBISHI i-MiEV
1416.51.90n/a213.07051318.42.1135B20.82.35n/a2.02014.0NISSAN LEAF
1517.21.90n/a222.97418319.62.2109B22.52.58n/a4.02014.0SMART FORTWO ELECTRIC DRIVE CABRIOLET
1617.21.90n/a222.97418319.62.2109B22.52.58n/a4.02014.0SMART FORTWO ELECTRIC DRIVE COUPE
1722.22.50n/a227.92601821.92.5335B21.72.410n/a5.02014.0TESLA MODEL S (60 kWh battery)
1823.82.70n/a227.92601823.62.6426B23.22.612n/a5.02014.0TESLA MODEL S (85 kWh battery)
1923.92.70n/a227.92601823.62.6426B23.22.612n/a5.02014.0TESLA MODEL S PERFORMANCE
2015.21.70n/a206.62339816.81.9130B18.82.14n/a1.02015.0BMW i3
21161.80n/a206.62339817.82131B19.62.27n/a1.02015.0CHEVROLET SPARK EV
22192.10n/a216.527068202.2122B21.12.44n/a3.02015.0FORD FOCUS ELECTRIC
2317.520n/a231.38257319.92.2149B22.72.64n/a6.02015.0KIA SOUL EV
2416.91.90n/a206.62339818.72.1100B21.42.47n/a1.02015.0MITSUBISHI i-MiEV
2516.51.90n/a211.57523318.42.1135B20.82.35n/a2.02015.0NISSAN LEAF
2617.21.90n/a221.47890319.62.2109B22.52.58n/a4.02015.0SMART FORTWO ELECTRIC DRIVE CABRIOLET
2717.21.90n/a221.47890319.62.2109B22.52.58n/a4.02015.0SMART FORTWO ELECTRIC DRIVE COUPE
2822.22.50n/a226.43073821.92.5335B21.72.410n/a5.02015.0TESLA MODEL S (60 kWh battery)
2923.82.70n/a226.43073823.62.6377B23.22.612n/a5.02015.0TESLA MODEL S (70 kWh battery)
...................................................
5323.42.6010224.93545822.52.5407B21.52.412n/a5.02016.0TESLA MODEL S P85D/P90D
5422.92.6010224.93545822.12.5435B212.412n/a5.02016.0TESLA MODEL S P90D (Refresh)
5522.62.5010224.93545821.52.4507B202.312n/a5.02016.0TESLA MODEL S P100D
56232.6010234.83912822.62.5322B22.22.510n/a7.02016.0TESLA MODEL X 60D
57232.6010234.83912822.52.5383B21.92.512n/a7.02016.0TESLA MODEL X 75D
5823.22.6010234.83912822.72.6414B22.22.512n/a7.02016.0TESLA MODEL X 90D
5923.62.7010234.83912823.52.6402B23.32.612n/a7.02016.0TESLA MODEL X P90D
6025.72.9010234.83912824.42.7465B22.92.612n/a7.02016.0TESLA MODEL X P100D
6115.21.7010203.63283916.81.9130B18.82.14101.02017.0BMW i3 (60 Ah)
6216.21.8010203.63283917.82183B19.72.25101.02017.0BMW i3 (94 Ah)
6316.41.8010228.39201417.62383B192.19.3106.02017.0CHEVROLET BOLT EV
6417.72010213.53650919.62.2185B21.82.55.5103.02017.0FORD FOCUS ELECTRIC
6517.42010228.39201419.92.2150B232.64106.02017.0KIA SOUL EV
6616.91.9010203.63283918.72.1100B20.52.37101.02017.0MITSUBISHI i-MiEV
67171.9010208.58467418.62.1172B20.72.36102.02017.0NISSAN LEAF
6821.52.4010223.44017921.12.4338B20.72.310105.02017.0TESLA MODEL S (60 kWh battery)
6921.52.4010223.44017921.32.4401B212.412105.02017.0TESLA MODEL S (75 kWh battery)
7020.62.3010223.44017920.22.3351B19.62.210105.02017.0TESLA MODEL S 60D
7120.62.3010223.44017920.32.3417B19.92.212105.02017.0TESLA MODEL S 75D
7220.62.3010223.44017920.22.3473B19.72.212105.02017.0TESLA MODEL S 90D
7320.72.3010223.44017920.62.3539B20.52.312105.02017.0TESLA MODEL S 100D
7422.82.6010223.440179222.5435B20.92.312105.02017.0TESLA MODEL S P90D
7522.62.5010223.44017921.52.4507B202.312105.02017.0TESLA MODEL S P100D
76232.6010233.34384922.62.5322B22.22.510107.02017.0TESLA MODEL X 60D
77232.6010233.34384922.52.5383B21.92.512107.02017.0TESLA MODEL X 75D
7823.22.6010233.34384922.72.6414B22.22.512107.02017.0TESLA MODEL X 90D
7924.32.7010233.343849242.7475B23.72.712107.02017.0TESLA MODEL X 100D
8023.62.7010233.34384923.52.6402B23.32.612107.02017.0TESLA MODEL X P90D
8125.72.9010233.34384924.42.7465B22.92.612107.02017.0TESLA MODEL X P100D
8216.81.9010213.53650917.42201B18.62.15.3103.02017.0VOLKSWAGEN e-GOLF
\n", - "

83 rows × 16 columns

\n", - "
" - ], - "text/plain": [ - " cityElec cityGas co2 co2Rate co2saved combElec combGas dist fuel \\\n", - "0 16.9 1.9 0 n/a 211.109237 18.7 2.1 100 B \n", - "1 19.3 2.2 0 n/a 216.061072 21.1 2.4 117 B \n", - "2 19 2.1 0 n/a 219.517627 20 2.2 122 B \n", - "3 16.9 1.9 0 n/a 209.613957 18.7 2.1 100 B \n", - "4 19.3 2.2 0 n/a 214.565792 21.1 2.4 117 B \n", - "5 17.2 1.9 0 n/a 224.469462 19.6 2.2 109 B \n", - "6 17.2 1.9 0 n/a 224.469462 19.6 2.2 109 B \n", - "7 22.4 2.5 0 n/a 229.421297 22.2 2.5 224 B \n", - "8 22.2 2.5 0 n/a 229.421297 21.9 2.5 335 B \n", - "9 23.8 2.7 0 n/a 229.421297 23.6 2.6 426 B \n", - "10 23.9 2.7 0 n/a 229.421297 23.6 2.6 426 B \n", - "11 16 1.8 0 n/a 208.118678 17.8 2 131 B \n", - "12 19 2.1 0 n/a 218.022348 20 2.2 122 B \n", - "13 16.9 1.9 0 n/a 208.118678 18.7 2.1 100 B \n", - "14 16.5 1.9 0 n/a 213.070513 18.4 2.1 135 B \n", - "15 17.2 1.9 0 n/a 222.974183 19.6 2.2 109 B \n", - "16 17.2 1.9 0 n/a 222.974183 19.6 2.2 109 B \n", - "17 22.2 2.5 0 n/a 227.926018 21.9 2.5 335 B \n", - "18 23.8 2.7 0 n/a 227.926018 23.6 2.6 426 B \n", - "19 23.9 2.7 0 n/a 227.926018 23.6 2.6 426 B \n", - "20 15.2 1.7 0 n/a 206.623398 16.8 1.9 130 B \n", - "21 16 1.8 0 n/a 206.623398 17.8 2 131 B \n", - "22 19 2.1 0 n/a 216.527068 20 2.2 122 B \n", - "23 17.5 2 0 n/a 231.382573 19.9 2.2 149 B \n", - "24 16.9 1.9 0 n/a 206.623398 18.7 2.1 100 B \n", - "25 16.5 1.9 0 n/a 211.575233 18.4 2.1 135 B \n", - "26 17.2 1.9 0 n/a 221.478903 19.6 2.2 109 B \n", - "27 17.2 1.9 0 n/a 221.478903 19.6 2.2 109 B \n", - "28 22.2 2.5 0 n/a 226.430738 21.9 2.5 335 B \n", - "29 23.8 2.7 0 n/a 226.430738 23.6 2.6 377 B \n", - ".. ... ... .. ... ... ... ... ... ... \n", - "53 23.4 2.6 0 10 224.935458 22.5 2.5 407 B \n", - "54 22.9 2.6 0 10 224.935458 22.1 2.5 435 B \n", - "55 22.6 2.5 0 10 224.935458 21.5 2.4 507 B \n", - "56 23 2.6 0 10 234.839128 22.6 2.5 322 B \n", - "57 23 2.6 0 10 234.839128 22.5 2.5 383 B \n", - "58 23.2 2.6 0 10 234.839128 22.7 2.6 414 B \n", - "59 23.6 2.7 0 10 234.839128 23.5 2.6 402 B \n", - "60 25.7 2.9 0 10 234.839128 24.4 2.7 465 B \n", - "61 15.2 1.7 0 10 203.632839 16.8 1.9 130 B \n", - "62 16.2 1.8 0 10 203.632839 17.8 2 183 B \n", - "63 16.4 1.8 0 10 228.392014 17.6 2 383 B \n", - "64 17.7 2 0 10 213.536509 19.6 2.2 185 B \n", - "65 17.4 2 0 10 228.392014 19.9 2.2 150 B \n", - "66 16.9 1.9 0 10 203.632839 18.7 2.1 100 B \n", - "67 17 1.9 0 10 208.584674 18.6 2.1 172 B \n", - "68 21.5 2.4 0 10 223.440179 21.1 2.4 338 B \n", - "69 21.5 2.4 0 10 223.440179 21.3 2.4 401 B \n", - "70 20.6 2.3 0 10 223.440179 20.2 2.3 351 B \n", - "71 20.6 2.3 0 10 223.440179 20.3 2.3 417 B \n", - "72 20.6 2.3 0 10 223.440179 20.2 2.3 473 B \n", - "73 20.7 2.3 0 10 223.440179 20.6 2.3 539 B \n", - "74 22.8 2.6 0 10 223.440179 22 2.5 435 B \n", - "75 22.6 2.5 0 10 223.440179 21.5 2.4 507 B \n", - "76 23 2.6 0 10 233.343849 22.6 2.5 322 B \n", - "77 23 2.6 0 10 233.343849 22.5 2.5 383 B \n", - "78 23.2 2.6 0 10 233.343849 22.7 2.6 414 B \n", - "79 24.3 2.7 0 10 233.343849 24 2.7 475 B \n", - "80 23.6 2.7 0 10 233.343849 23.5 2.6 402 B \n", - "81 25.7 2.9 0 10 233.343849 24.4 2.7 465 B \n", - "82 16.8 1.9 0 10 213.536509 17.4 2 201 B \n", - "\n", - " hwyElec hwyGas recharge smogRate vclass year \\\n", - "0 21.4 2.4 7 n/a 1.0 2012.0 \n", - "1 23 2.6 7 n/a 2.0 2012.0 \n", - "2 21.1 2.4 4 n/a 3.0 2013.0 \n", - "3 21.4 2.4 7 n/a 1.0 2013.0 \n", - "4 23 2.6 7 n/a 2.0 2013.0 \n", - "5 22.5 2.5 8 n/a 4.0 2013.0 \n", - "6 22.5 2.5 8 n/a 4.0 2013.0 \n", - "7 21.9 2.5 6 n/a 5.0 2013.0 \n", - "8 21.7 2.4 10 n/a 5.0 2013.0 \n", - "9 23.2 2.6 12 n/a 5.0 2013.0 \n", - "10 23.2 2.6 12 n/a 5.0 2013.0 \n", - "11 19.6 2.2 7 n/a 1.0 2014.0 \n", - "12 21.1 2.4 4 n/a 3.0 2014.0 \n", - "13 21.4 2.4 7 n/a 1.0 2014.0 \n", - "14 20.8 2.3 5 n/a 2.0 2014.0 \n", - "15 22.5 2.5 8 n/a 4.0 2014.0 \n", - "16 22.5 2.5 8 n/a 4.0 2014.0 \n", - "17 21.7 2.4 10 n/a 5.0 2014.0 \n", - "18 23.2 2.6 12 n/a 5.0 2014.0 \n", - "19 23.2 2.6 12 n/a 5.0 2014.0 \n", - "20 18.8 2.1 4 n/a 1.0 2015.0 \n", - "21 19.6 2.2 7 n/a 1.0 2015.0 \n", - "22 21.1 2.4 4 n/a 3.0 2015.0 \n", - "23 22.7 2.6 4 n/a 6.0 2015.0 \n", - "24 21.4 2.4 7 n/a 1.0 2015.0 \n", - "25 20.8 2.3 5 n/a 2.0 2015.0 \n", - "26 22.5 2.5 8 n/a 4.0 2015.0 \n", - "27 22.5 2.5 8 n/a 4.0 2015.0 \n", - "28 21.7 2.4 10 n/a 5.0 2015.0 \n", - "29 23.2 2.6 12 n/a 5.0 2015.0 \n", - ".. ... ... ... ... ... ... \n", - "53 21.5 2.4 12 n/a 5.0 2016.0 \n", - "54 21 2.4 12 n/a 5.0 2016.0 \n", - "55 20 2.3 12 n/a 5.0 2016.0 \n", - "56 22.2 2.5 10 n/a 7.0 2016.0 \n", - "57 21.9 2.5 12 n/a 7.0 2016.0 \n", - "58 22.2 2.5 12 n/a 7.0 2016.0 \n", - "59 23.3 2.6 12 n/a 7.0 2016.0 \n", - "60 22.9 2.6 12 n/a 7.0 2016.0 \n", - "61 18.8 2.1 4 10 1.0 2017.0 \n", - "62 19.7 2.2 5 10 1.0 2017.0 \n", - "63 19 2.1 9.3 10 6.0 2017.0 \n", - "64 21.8 2.5 5.5 10 3.0 2017.0 \n", - "65 23 2.6 4 10 6.0 2017.0 \n", - "66 20.5 2.3 7 10 1.0 2017.0 \n", - "67 20.7 2.3 6 10 2.0 2017.0 \n", - "68 20.7 2.3 10 10 5.0 2017.0 \n", - "69 21 2.4 12 10 5.0 2017.0 \n", - "70 19.6 2.2 10 10 5.0 2017.0 \n", - "71 19.9 2.2 12 10 5.0 2017.0 \n", - "72 19.7 2.2 12 10 5.0 2017.0 \n", - "73 20.5 2.3 12 10 5.0 2017.0 \n", - "74 20.9 2.3 12 10 5.0 2017.0 \n", - "75 20 2.3 12 10 5.0 2017.0 \n", - "76 22.2 2.5 10 10 7.0 2017.0 \n", - "77 21.9 2.5 12 10 7.0 2017.0 \n", - "78 22.2 2.5 12 10 7.0 2017.0 \n", - "79 23.7 2.7 12 10 7.0 2017.0 \n", - "80 23.3 2.6 12 10 7.0 2017.0 \n", - "81 22.9 2.6 12 10 7.0 2017.0 \n", - "82 18.6 2.1 5.3 10 3.0 2017.0 \n", - "\n", - " vehicle \n", - "0 MITSUBISHI i-MiEV \n", - "1 NISSAN LEAF \n", - "2 FORD FOCUS ELECTRIC \n", - "3 MITSUBISHI i-MiEV \n", - "4 NISSAN LEAF \n", - "5 SMART FORTWO ELECTRIC DRIVE CABRIOLET \n", - "6 SMART FORTWO ELECTRIC DRIVE COUPE \n", - "7 TESLA MODEL S (40 kWh battery) \n", - "8 TESLA MODEL S (60 kWh battery) \n", - "9 TESLA MODEL S (85 kWh battery) \n", - "10 TESLA MODEL S PERFORMANCE \n", - "11 CHEVROLET SPARK EV \n", - "12 FORD FOCUS ELECTRIC \n", - "13 MITSUBISHI i-MiEV \n", - "14 NISSAN LEAF \n", - "15 SMART FORTWO ELECTRIC DRIVE CABRIOLET \n", - "16 SMART FORTWO ELECTRIC DRIVE COUPE \n", - "17 TESLA MODEL S (60 kWh battery) \n", - "18 TESLA MODEL S (85 kWh battery) \n", - "19 TESLA MODEL S PERFORMANCE \n", - "20 BMW i3 \n", - "21 CHEVROLET SPARK EV \n", - "22 FORD FOCUS ELECTRIC \n", - "23 KIA SOUL EV \n", - "24 MITSUBISHI i-MiEV \n", - "25 NISSAN LEAF \n", - "26 SMART FORTWO ELECTRIC DRIVE CABRIOLET \n", - "27 SMART FORTWO ELECTRIC DRIVE COUPE \n", - "28 TESLA MODEL S (60 kWh battery) \n", - "29 TESLA MODEL S (70 kWh battery) \n", - ".. ... \n", - "53 TESLA MODEL S P85D/P90D \n", - "54 TESLA MODEL S P90D (Refresh) \n", - "55 TESLA MODEL S P100D \n", - "56 TESLA MODEL X 60D \n", - "57 TESLA MODEL X 75D \n", - "58 TESLA MODEL X 90D \n", - "59 TESLA MODEL X P90D \n", - "60 TESLA MODEL X P100D \n", - "61 BMW i3 (60 Ah) \n", - "62 BMW i3 (94 Ah) \n", - "63 CHEVROLET BOLT EV \n", - "64 FORD FOCUS ELECTRIC \n", - "65 KIA SOUL EV \n", - "66 MITSUBISHI i-MiEV \n", - "67 NISSAN LEAF \n", - "68 TESLA MODEL S (60 kWh battery) \n", - "69 TESLA MODEL S (75 kWh battery) \n", - "70 TESLA MODEL S 60D \n", - "71 TESLA MODEL S 75D \n", - "72 TESLA MODEL S 90D \n", - "73 TESLA MODEL S 100D \n", - "74 TESLA MODEL S P90D \n", - "75 TESLA MODEL S P100D \n", - "76 TESLA MODEL X 60D \n", - "77 TESLA MODEL X 75D \n", - "78 TESLA MODEL X 90D \n", - "79 TESLA MODEL X 100D \n", - "80 TESLA MODEL X P90D \n", - "81 TESLA MODEL X P100D \n", - "82 VOLKSWAGEN e-GOLF \n", - "\n", - "[83 rows x 16 columns]" - ] - }, - "execution_count": 57, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "db.drop([\"make\",\"model\"],inplace=True,axis=1)\n", - "db" - ] - }, - { - "cell_type": "code", - "execution_count": 58, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "db.to_csv('Database.csv')\n", - "db.to_json('Databasejs.json')" - ] - } - ], - "metadata": { - "anaconda-cloud": {}, - "kernelspec": { - "display_name": "Python [default]", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.5.2" - } - }, - "nbformat": 4, - "nbformat_minor": 1 -} From 6e3f423f9ed4b9905b8c62bbe4606af7f7c75435 Mon Sep 17 00:00:00 2001 From: Mashrin Srivastava Date: Mon, 23 Oct 2017 01:07:49 +0530 Subject: [PATCH 2/2] Delete Fuel prediction and co2 emission-checkpoint.ipynb --- ...ediction and co2 emission-checkpoint.ipynb | 12816 ---------------- 1 file changed, 12816 deletions(-) delete mode 100644 Fuel_prediction/.ipynb_checkpoints/Fuel prediction and co2 emission-checkpoint.ipynb diff --git a/Fuel_prediction/.ipynb_checkpoints/Fuel prediction and co2 emission-checkpoint.ipynb b/Fuel_prediction/.ipynb_checkpoints/Fuel prediction and co2 emission-checkpoint.ipynb deleted file mode 100644 index 3ba4038..0000000 --- a/Fuel_prediction/.ipynb_checkpoints/Fuel prediction and co2 emission-checkpoint.ipynb +++ /dev/null @@ -1,12816 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### GOAL: \n", - "1. Get the Shortest Distance between two places\n", - "2. Get the fuel estimation for the journey\n", - "3. How much CO2 have you saved from being emitted?\n", - "4. Get the estimated time required to travel based on the recharge time\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Understanding the dataset for electric cars\n", - "Transmission: A = Automatic AV = Continuously variable\n", - "\n", - "Fuel Type: B = Electricity X = Regular gasoline Z = Premium gasoline (since this is a dataset of Electric vehicles all are B)\n", - "\n", - "Consumption: The combined fuel consumption rating reflects 55 percent city and 45 percent highway driving. 2 Le is gasoline litre equivalent. One litre of gasoline contains the energy equivalent to 8.9 kWh of electricity. \n", - "\n", - "CO2 Emissions: the tailpipe emissions of carbon dioxide (in grams per kilometre) for combined city and highway driving. \n", - "\n", - "CO2 Rating: the tailpipe emissions of carbon dioxide rated on a scale from 1 (worst) to 10 (best). \n", - "\n", - "Smog Rating: the tailpipe emissions of smog-forming pollutants rated on a scale from 1 (worst) to 10 (best). \n", - "\n", - "Range: the estimated driving distance (in kilometres) on a fully charged battery or full tank of fuel. \n", - "\n", - "Recharge time: the estimated time (in hours) to fully recharge the battery at 240 volts\n" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "#importing the necessacary packages in python\n", - "import matplotlib.pyplot as plt\n", - "import pandas as pd\n", - "import pylab as pl\n", - "import numpy as np\n", - "import statsmodels.formula.api as smf\n", - "%matplotlib inline" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
MODELMAKEMODEL.1VEHICLE CLASSMOTORTRANSMISSIONFUELCONSUMPTIONUnnamed: 8Unnamed: 9Unnamed: 10Unnamed: 11Unnamed: 12CO2 EMISSIONSCO2SMOGRANGERECHARGE
0YEARNaNNaNNaN(kW)NaNTYPECITY (kWh/100 km)HWY (kWh/100 km)COMB (kWh/100 km)CITY (Le/100 km)HWY (Le/100 km)COMB (Le/100 km)(g/km)RATINGRATING(km)TIME (h)
12012MITSUBISHIi-MiEVSUBCOMPACT49A1B16.921.418.71.92.42.10n/an/a1007
22012NISSANLEAFMID-SIZE80A1B19.32321.12.22.62.40n/an/a1177
32013FORDFOCUS ELECTRICCOMPACT107A1B1921.1202.12.42.20n/an/a1224
42013MITSUBISHIi-MiEVSUBCOMPACT49A1B16.921.418.71.92.42.10n/an/a1007
\n", - "
" - ], - "text/plain": [ - " MODEL MAKE MODEL.1 VEHICLE CLASS MOTOR TRANSMISSION FUEL \\\n", - "0 YEAR NaN NaN NaN (kW) NaN TYPE \n", - "1 2012 MITSUBISHI i-MiEV SUBCOMPACT 49 A1 B \n", - "2 2012 NISSAN LEAF MID-SIZE 80 A1 B \n", - "3 2013 FORD FOCUS ELECTRIC COMPACT 107 A1 B \n", - "4 2013 MITSUBISHI i-MiEV SUBCOMPACT 49 A1 B \n", - "\n", - " CONSUMPTION Unnamed: 8 Unnamed: 9 Unnamed: 10 \\\n", - "0 CITY (kWh/100 km) HWY (kWh/100 km) COMB (kWh/100 km) CITY (Le/100 km) \n", - "1 16.9 21.4 18.7 1.9 \n", - "2 19.3 23 21.1 2.2 \n", - "3 19 21.1 20 2.1 \n", - "4 16.9 21.4 18.7 1.9 \n", - "\n", - " Unnamed: 11 Unnamed: 12 CO2 EMISSIONS CO2 SMOG RANGE \\\n", - "0 HWY (Le/100 km) COMB (Le/100 km) (g/km) RATING RATING (km) \n", - "1 2.4 2.1 0 n/a n/a 100 \n", - "2 2.6 2.4 0 n/a n/a 117 \n", - "3 2.4 2.2 0 n/a n/a 122 \n", - "4 2.4 2.1 0 n/a n/a 100 \n", - "\n", - " RECHARGE \n", - "0 TIME (h) \n", - "1 7 \n", - "2 7 \n", - "3 4 \n", - "4 7 " - ] - }, - "execution_count": 2, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "elec = pd.read_csv(\"fuel consumption dataset\\MY2012-2017 Battery Electric Vehicles.csv\")\n", - "elec.head() #display the column names and sample data" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
MODELMAKEMODEL.1VEHICLE CLASSFUELCONSUMPTIONUnnamed: 8Unnamed: 9Unnamed: 10Unnamed: 11Unnamed: 12CO2 EMISSIONSCO2SMOGRANGERECHARGE
0YEARNaNNaNNaNTYPECITY (kWh/100 km)HWY (kWh/100 km)COMB (kWh/100 km)CITY (Le/100 km)HWY (Le/100 km)COMB (Le/100 km)(g/km)RATINGRATING(km)TIME (h)
12012MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
22012NISSANLEAFMID-SIZEB19.32321.12.22.62.40n/an/a1177
32013FORDFOCUS ELECTRICCOMPACTB1921.1202.12.42.20n/an/a1224
42013MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
52013NISSANLEAFMID-SIZEB19.32321.12.22.62.40n/an/a1177
62013SMARTFORTWO ELECTRIC DRIVE CABRIOLETTWO-SEATERB17.222.519.61.92.52.20n/an/a1098
72013SMARTFORTWO ELECTRIC DRIVE COUPETWO-SEATERB17.222.519.61.92.52.20n/an/a1098
82013TESLAMODEL S (40 kWh battery)FULL-SIZEB22.421.922.22.52.52.50n/an/a2246
92013TESLAMODEL S (60 kWh battery)FULL-SIZEB22.221.721.92.52.42.50n/an/a33510
102013TESLAMODEL S (85 kWh battery)FULL-SIZEB23.823.223.62.72.62.60n/an/a42612
112013TESLAMODEL S PERFORMANCEFULL-SIZEB23.923.223.62.72.62.60n/an/a42612
122014CHEVROLETSPARK EVSUBCOMPACTB1619.617.81.82.220n/an/a1317
132014FORDFOCUS ELECTRICCOMPACTB1921.1202.12.42.20n/an/a1224
142014MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
152014NISSANLEAFMID-SIZEB16.520.818.41.92.32.10n/an/a1355
162014SMARTFORTWO ELECTRIC DRIVE CABRIOLETTWO-SEATERB17.222.519.61.92.52.20n/an/a1098
172014SMARTFORTWO ELECTRIC DRIVE COUPETWO-SEATERB17.222.519.61.92.52.20n/an/a1098
182014TESLAMODEL S (60 kWh battery)FULL-SIZEB22.221.721.92.52.42.50n/an/a33510
192014TESLAMODEL S (85 kWh battery)FULL-SIZEB23.823.223.62.72.62.60n/an/a42612
202014TESLAMODEL S PERFORMANCEFULL-SIZEB23.923.223.62.72.62.60n/an/a42612
212015BMWi3SUBCOMPACTB15.218.816.81.72.11.90n/an/a1304
222015CHEVROLETSPARK EVSUBCOMPACTB1619.617.81.82.220n/an/a1317
232015FORDFOCUS ELECTRICCOMPACTB1921.1202.12.42.20n/an/a1224
242015KIASOUL EVSTATION WAGON - SMALLB17.522.719.922.62.20n/an/a1494
252015MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
262015NISSANLEAFMID-SIZEB16.520.818.41.92.32.10n/an/a1355
272015SMARTFORTWO ELECTRIC DRIVE CABRIOLETTWO-SEATERB17.222.519.61.92.52.20n/an/a1098
282015SMARTFORTWO ELECTRIC DRIVE COUPETWO-SEATERB17.222.519.61.92.52.20n/an/a1098
292015TESLAMODEL S (60 kWh battery)FULL-SIZEB22.221.721.92.52.42.50n/an/a33510
...................................................
542016TESLAMODEL S P85D/P90DFULL-SIZEB23.421.522.52.62.42.5010n/a40712
552016TESLAMODEL S P90D (Refresh)FULL-SIZEB22.92122.12.62.42.5010n/a43512
562016TESLAMODEL S P100DFULL-SIZEB22.62021.52.52.32.4010n/a50712
572016TESLAMODEL X 60DSUV - STANDARDB2322.222.62.62.52.5010n/a32210
582016TESLAMODEL X 75DSUV - STANDARDB2321.922.52.62.52.5010n/a38312
592016TESLAMODEL X 90DSUV - STANDARDB23.222.222.72.62.52.6010n/a41412
602016TESLAMODEL X P90DSUV - STANDARDB23.623.323.52.72.62.6010n/a40212
612016TESLAMODEL X P100DSUV - STANDARDB25.722.924.42.92.62.7010n/a46512
622017BMWi3 (60 Ah)SUBCOMPACTB15.218.816.81.72.11.9010101304
632017BMWi3 (94 Ah)SUBCOMPACTB16.219.717.81.82.22010101835
642017CHEVROLETBOLT EVSTATION WAGON - SMALLB16.41917.61.82.12010103839.3
652017FORDFOCUS ELECTRICCOMPACTB17.721.819.622.52.2010101855.5
662017KIASOUL EVSTATION WAGON - SMALLB17.42319.922.62.2010101504
672017MITSUBISHIi-MiEVSUBCOMPACTB16.920.518.71.92.32.1010101007
682017NISSANLEAFMID-SIZEB1720.718.61.92.32.1010101726
692017TESLAMODEL S (60 kWh battery)FULL-SIZEB21.520.721.12.42.32.40101033810
702017TESLAMODEL S (75 kWh battery)FULL-SIZEB21.52121.32.42.42.40101040112
712017TESLAMODEL S 60DFULL-SIZEB20.619.620.22.32.22.30101035110
722017TESLAMODEL S 75DFULL-SIZEB20.619.920.32.32.22.30101041712
732017TESLAMODEL S 90DFULL-SIZEB20.619.720.22.32.22.30101047312
742017TESLAMODEL S 100DFULL-SIZEB20.720.520.62.32.32.30101053912
752017TESLAMODEL S P90DFULL-SIZEB22.820.9222.62.32.50101043512
762017TESLAMODEL S P100DFULL-SIZEB22.62021.52.52.32.40101050712
772017TESLAMODEL X 60DSUV - STANDARDB2322.222.62.62.52.50101032210
782017TESLAMODEL X 75DSUV - STANDARDB2321.922.52.62.52.50101038312
792017TESLAMODEL X 90DSUV - STANDARDB23.222.222.72.62.52.60101041412
802017TESLAMODEL X 100DSUV - STANDARDB24.323.7242.72.72.70101047512
812017TESLAMODEL X P90DSUV - STANDARDB23.623.323.52.72.62.60101040212
822017TESLAMODEL X P100DSUV - STANDARDB25.722.924.42.92.62.70101046512
832017VOLKSWAGENe-GOLFCOMPACTB16.818.617.41.92.12010102015.3
\n", - "

84 rows × 16 columns

\n", - "
" - ], - "text/plain": [ - " MODEL MAKE MODEL.1 VEHICLE CLASS \\\n", - "0 YEAR NaN NaN NaN \n", - "1 2012 MITSUBISHI i-MiEV SUBCOMPACT \n", - "2 2012 NISSAN LEAF MID-SIZE \n", - "3 2013 FORD FOCUS ELECTRIC COMPACT \n", - "4 2013 MITSUBISHI i-MiEV SUBCOMPACT \n", - "5 2013 NISSAN LEAF MID-SIZE \n", - "6 2013 SMART FORTWO ELECTRIC DRIVE CABRIOLET TWO-SEATER \n", - "7 2013 SMART FORTWO ELECTRIC DRIVE COUPE TWO-SEATER \n", - "8 2013 TESLA MODEL S (40 kWh battery) FULL-SIZE \n", - "9 2013 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "10 2013 TESLA MODEL S (85 kWh battery) FULL-SIZE \n", - "11 2013 TESLA MODEL S PERFORMANCE FULL-SIZE \n", - "12 2014 CHEVROLET SPARK EV SUBCOMPACT \n", - "13 2014 FORD FOCUS ELECTRIC COMPACT \n", - "14 2014 MITSUBISHI i-MiEV SUBCOMPACT \n", - "15 2014 NISSAN LEAF MID-SIZE \n", - "16 2014 SMART FORTWO ELECTRIC DRIVE CABRIOLET TWO-SEATER \n", - "17 2014 SMART FORTWO ELECTRIC DRIVE COUPE TWO-SEATER \n", - "18 2014 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "19 2014 TESLA MODEL S (85 kWh battery) FULL-SIZE \n", - "20 2014 TESLA MODEL S PERFORMANCE FULL-SIZE \n", - "21 2015 BMW i3 SUBCOMPACT \n", - "22 2015 CHEVROLET SPARK EV SUBCOMPACT \n", - "23 2015 FORD FOCUS ELECTRIC COMPACT \n", - "24 2015 KIA SOUL EV STATION WAGON - SMALL \n", - "25 2015 MITSUBISHI i-MiEV SUBCOMPACT \n", - "26 2015 NISSAN LEAF MID-SIZE \n", - "27 2015 SMART FORTWO ELECTRIC DRIVE CABRIOLET TWO-SEATER \n", - "28 2015 SMART FORTWO ELECTRIC DRIVE COUPE TWO-SEATER \n", - "29 2015 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - ".. ... ... ... ... \n", - "54 2016 TESLA MODEL S P85D/P90D FULL-SIZE \n", - "55 2016 TESLA MODEL S P90D (Refresh) FULL-SIZE \n", - "56 2016 TESLA MODEL S P100D FULL-SIZE \n", - "57 2016 TESLA MODEL X 60D SUV - STANDARD \n", - "58 2016 TESLA MODEL X 75D SUV - STANDARD \n", - "59 2016 TESLA MODEL X 90D SUV - STANDARD \n", - "60 2016 TESLA MODEL X P90D SUV - STANDARD \n", - "61 2016 TESLA MODEL X P100D SUV - STANDARD \n", - "62 2017 BMW i3 (60 Ah) SUBCOMPACT \n", - "63 2017 BMW i3 (94 Ah) SUBCOMPACT \n", - "64 2017 CHEVROLET BOLT EV STATION WAGON - SMALL \n", - "65 2017 FORD FOCUS ELECTRIC COMPACT \n", - "66 2017 KIA SOUL EV STATION WAGON - SMALL \n", - "67 2017 MITSUBISHI i-MiEV SUBCOMPACT \n", - "68 2017 NISSAN LEAF MID-SIZE \n", - "69 2017 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "70 2017 TESLA MODEL S (75 kWh battery) FULL-SIZE \n", - "71 2017 TESLA MODEL S 60D FULL-SIZE \n", - "72 2017 TESLA MODEL S 75D FULL-SIZE \n", - "73 2017 TESLA MODEL S 90D FULL-SIZE \n", - "74 2017 TESLA MODEL S 100D FULL-SIZE \n", - "75 2017 TESLA MODEL S P90D FULL-SIZE \n", - "76 2017 TESLA MODEL S P100D FULL-SIZE \n", - "77 2017 TESLA MODEL X 60D SUV - STANDARD \n", - "78 2017 TESLA MODEL X 75D SUV - STANDARD \n", - "79 2017 TESLA MODEL X 90D SUV - STANDARD \n", - "80 2017 TESLA MODEL X 100D SUV - STANDARD \n", - "81 2017 TESLA MODEL X P90D SUV - STANDARD \n", - "82 2017 TESLA MODEL X P100D SUV - STANDARD \n", - "83 2017 VOLKSWAGEN e-GOLF COMPACT \n", - "\n", - " FUEL CONSUMPTION Unnamed: 8 Unnamed: 9 \\\n", - "0 TYPE CITY (kWh/100 km) HWY (kWh/100 km) COMB (kWh/100 km) \n", - "1 B 16.9 21.4 18.7 \n", - "2 B 19.3 23 21.1 \n", - "3 B 19 21.1 20 \n", - "4 B 16.9 21.4 18.7 \n", - "5 B 19.3 23 21.1 \n", - "6 B 17.2 22.5 19.6 \n", - "7 B 17.2 22.5 19.6 \n", - "8 B 22.4 21.9 22.2 \n", - "9 B 22.2 21.7 21.9 \n", - "10 B 23.8 23.2 23.6 \n", - "11 B 23.9 23.2 23.6 \n", - "12 B 16 19.6 17.8 \n", - "13 B 19 21.1 20 \n", - "14 B 16.9 21.4 18.7 \n", - "15 B 16.5 20.8 18.4 \n", - "16 B 17.2 22.5 19.6 \n", - "17 B 17.2 22.5 19.6 \n", - "18 B 22.2 21.7 21.9 \n", - "19 B 23.8 23.2 23.6 \n", - "20 B 23.9 23.2 23.6 \n", - "21 B 15.2 18.8 16.8 \n", - "22 B 16 19.6 17.8 \n", - "23 B 19 21.1 20 \n", - "24 B 17.5 22.7 19.9 \n", - "25 B 16.9 21.4 18.7 \n", - "26 B 16.5 20.8 18.4 \n", - "27 B 17.2 22.5 19.6 \n", - "28 B 17.2 22.5 19.6 \n", - "29 B 22.2 21.7 21.9 \n", - ".. ... ... ... ... \n", - "54 B 23.4 21.5 22.5 \n", - "55 B 22.9 21 22.1 \n", - "56 B 22.6 20 21.5 \n", - "57 B 23 22.2 22.6 \n", - "58 B 23 21.9 22.5 \n", - "59 B 23.2 22.2 22.7 \n", - "60 B 23.6 23.3 23.5 \n", - "61 B 25.7 22.9 24.4 \n", - "62 B 15.2 18.8 16.8 \n", - "63 B 16.2 19.7 17.8 \n", - "64 B 16.4 19 17.6 \n", - "65 B 17.7 21.8 19.6 \n", - "66 B 17.4 23 19.9 \n", - "67 B 16.9 20.5 18.7 \n", - "68 B 17 20.7 18.6 \n", - "69 B 21.5 20.7 21.1 \n", - "70 B 21.5 21 21.3 \n", - "71 B 20.6 19.6 20.2 \n", - "72 B 20.6 19.9 20.3 \n", - "73 B 20.6 19.7 20.2 \n", - "74 B 20.7 20.5 20.6 \n", - "75 B 22.8 20.9 22 \n", - "76 B 22.6 20 21.5 \n", - "77 B 23 22.2 22.6 \n", - "78 B 23 21.9 22.5 \n", - "79 B 23.2 22.2 22.7 \n", - "80 B 24.3 23.7 24 \n", - "81 B 23.6 23.3 23.5 \n", - "82 B 25.7 22.9 24.4 \n", - "83 B 16.8 18.6 17.4 \n", - "\n", - " Unnamed: 10 Unnamed: 11 Unnamed: 12 CO2 EMISSIONS CO2 \\\n", - "0 CITY (Le/100 km) HWY (Le/100 km) COMB (Le/100 km) (g/km) RATING \n", - "1 1.9 2.4 2.1 0 n/a \n", - "2 2.2 2.6 2.4 0 n/a \n", - "3 2.1 2.4 2.2 0 n/a \n", - "4 1.9 2.4 2.1 0 n/a \n", - "5 2.2 2.6 2.4 0 n/a \n", - "6 1.9 2.5 2.2 0 n/a \n", - "7 1.9 2.5 2.2 0 n/a \n", - "8 2.5 2.5 2.5 0 n/a \n", - "9 2.5 2.4 2.5 0 n/a \n", - "10 2.7 2.6 2.6 0 n/a \n", - "11 2.7 2.6 2.6 0 n/a \n", - "12 1.8 2.2 2 0 n/a \n", - "13 2.1 2.4 2.2 0 n/a \n", - "14 1.9 2.4 2.1 0 n/a \n", - "15 1.9 2.3 2.1 0 n/a \n", - "16 1.9 2.5 2.2 0 n/a \n", - "17 1.9 2.5 2.2 0 n/a \n", - "18 2.5 2.4 2.5 0 n/a \n", - "19 2.7 2.6 2.6 0 n/a \n", - "20 2.7 2.6 2.6 0 n/a \n", - "21 1.7 2.1 1.9 0 n/a \n", - "22 1.8 2.2 2 0 n/a \n", - "23 2.1 2.4 2.2 0 n/a \n", - "24 2 2.6 2.2 0 n/a \n", - "25 1.9 2.4 2.1 0 n/a \n", - "26 1.9 2.3 2.1 0 n/a \n", - "27 1.9 2.5 2.2 0 n/a \n", - "28 1.9 2.5 2.2 0 n/a \n", - "29 2.5 2.4 2.5 0 n/a \n", - ".. ... ... ... ... ... \n", - "54 2.6 2.4 2.5 0 10 \n", - "55 2.6 2.4 2.5 0 10 \n", - "56 2.5 2.3 2.4 0 10 \n", - "57 2.6 2.5 2.5 0 10 \n", - "58 2.6 2.5 2.5 0 10 \n", - "59 2.6 2.5 2.6 0 10 \n", - "60 2.7 2.6 2.6 0 10 \n", - "61 2.9 2.6 2.7 0 10 \n", - "62 1.7 2.1 1.9 0 10 \n", - "63 1.8 2.2 2 0 10 \n", - "64 1.8 2.1 2 0 10 \n", - "65 2 2.5 2.2 0 10 \n", - "66 2 2.6 2.2 0 10 \n", - "67 1.9 2.3 2.1 0 10 \n", - "68 1.9 2.3 2.1 0 10 \n", - "69 2.4 2.3 2.4 0 10 \n", - "70 2.4 2.4 2.4 0 10 \n", - "71 2.3 2.2 2.3 0 10 \n", - "72 2.3 2.2 2.3 0 10 \n", - "73 2.3 2.2 2.3 0 10 \n", - "74 2.3 2.3 2.3 0 10 \n", - "75 2.6 2.3 2.5 0 10 \n", - "76 2.5 2.3 2.4 0 10 \n", - "77 2.6 2.5 2.5 0 10 \n", - "78 2.6 2.5 2.5 0 10 \n", - "79 2.6 2.5 2.6 0 10 \n", - "80 2.7 2.7 2.7 0 10 \n", - "81 2.7 2.6 2.6 0 10 \n", - "82 2.9 2.6 2.7 0 10 \n", - "83 1.9 2.1 2 0 10 \n", - "\n", - " SMOG RANGE RECHARGE \n", - "0 RATING (km) TIME (h) \n", - "1 n/a 100 7 \n", - "2 n/a 117 7 \n", - "3 n/a 122 4 \n", - "4 n/a 100 7 \n", - "5 n/a 117 7 \n", - "6 n/a 109 8 \n", - "7 n/a 109 8 \n", - "8 n/a 224 6 \n", - "9 n/a 335 10 \n", - "10 n/a 426 12 \n", - "11 n/a 426 12 \n", - "12 n/a 131 7 \n", - "13 n/a 122 4 \n", - "14 n/a 100 7 \n", - "15 n/a 135 5 \n", - "16 n/a 109 8 \n", - "17 n/a 109 8 \n", - "18 n/a 335 10 \n", - "19 n/a 426 12 \n", - "20 n/a 426 12 \n", - "21 n/a 130 4 \n", - "22 n/a 131 7 \n", - "23 n/a 122 4 \n", - "24 n/a 149 4 \n", - "25 n/a 100 7 \n", - "26 n/a 135 5 \n", - "27 n/a 109 8 \n", - "28 n/a 109 8 \n", - "29 n/a 335 10 \n", - ".. ... ... ... \n", - "54 n/a 407 12 \n", - "55 n/a 435 12 \n", - "56 n/a 507 12 \n", - "57 n/a 322 10 \n", - "58 n/a 383 12 \n", - "59 n/a 414 12 \n", - "60 n/a 402 12 \n", - "61 n/a 465 12 \n", - "62 10 130 4 \n", - "63 10 183 5 \n", - "64 10 383 9.3 \n", - "65 10 185 5.5 \n", - "66 10 150 4 \n", - "67 10 100 7 \n", - "68 10 172 6 \n", - "69 10 338 10 \n", - "70 10 401 12 \n", - "71 10 351 10 \n", - "72 10 417 12 \n", - "73 10 473 12 \n", - "74 10 539 12 \n", - "75 10 435 12 \n", - "76 10 507 12 \n", - "77 10 322 10 \n", - "78 10 383 12 \n", - "79 10 414 12 \n", - "80 10 475 12 \n", - "81 10 402 12 \n", - "82 10 465 12 \n", - "83 10 201 5.3 \n", - "\n", - "[84 rows x 16 columns]" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cols = [u'MODEL', u'MAKE', u'MODEL.1', u'VEHICLE CLASS', u'FUEL', u'CONSUMPTION', u'Unnamed: 8', u'Unnamed: 9',\n", - " u'Unnamed: 10', u'Unnamed: 11', u'Unnamed: 12', u'CO2 EMISSIONS', u'CO2 ', u'SMOG', u'RANGE', u'RECHARGE']\n", - "elec=elec[cols] #select only the columns we need\n", - "elec " - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
yearmakemodelvclassfuelcityElechwyEleccombEleccityGashwyGascombGasco2co2RatesmogRatedistrecharge
0YEARNaNNaNNaNTYPECITY (kWh/100 km)HWY (kWh/100 km)COMB (kWh/100 km)CITY (Le/100 km)HWY (Le/100 km)COMB (Le/100 km)(g/km)RATINGRATING(km)TIME (h)
12012MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
22012NISSANLEAFMID-SIZEB19.32321.12.22.62.40n/an/a1177
32013FORDFOCUS ELECTRICCOMPACTB1921.1202.12.42.20n/an/a1224
42013MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
52013NISSANLEAFMID-SIZEB19.32321.12.22.62.40n/an/a1177
62013SMARTFORTWO ELECTRIC DRIVE CABRIOLETTWO-SEATERB17.222.519.61.92.52.20n/an/a1098
72013SMARTFORTWO ELECTRIC DRIVE COUPETWO-SEATERB17.222.519.61.92.52.20n/an/a1098
82013TESLAMODEL S (40 kWh battery)FULL-SIZEB22.421.922.22.52.52.50n/an/a2246
92013TESLAMODEL S (60 kWh battery)FULL-SIZEB22.221.721.92.52.42.50n/an/a33510
102013TESLAMODEL S (85 kWh battery)FULL-SIZEB23.823.223.62.72.62.60n/an/a42612
112013TESLAMODEL S PERFORMANCEFULL-SIZEB23.923.223.62.72.62.60n/an/a42612
122014CHEVROLETSPARK EVSUBCOMPACTB1619.617.81.82.220n/an/a1317
132014FORDFOCUS ELECTRICCOMPACTB1921.1202.12.42.20n/an/a1224
142014MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
152014NISSANLEAFMID-SIZEB16.520.818.41.92.32.10n/an/a1355
162014SMARTFORTWO ELECTRIC DRIVE CABRIOLETTWO-SEATERB17.222.519.61.92.52.20n/an/a1098
172014SMARTFORTWO ELECTRIC DRIVE COUPETWO-SEATERB17.222.519.61.92.52.20n/an/a1098
182014TESLAMODEL S (60 kWh battery)FULL-SIZEB22.221.721.92.52.42.50n/an/a33510
192014TESLAMODEL S (85 kWh battery)FULL-SIZEB23.823.223.62.72.62.60n/an/a42612
202014TESLAMODEL S PERFORMANCEFULL-SIZEB23.923.223.62.72.62.60n/an/a42612
212015BMWi3SUBCOMPACTB15.218.816.81.72.11.90n/an/a1304
222015CHEVROLETSPARK EVSUBCOMPACTB1619.617.81.82.220n/an/a1317
232015FORDFOCUS ELECTRICCOMPACTB1921.1202.12.42.20n/an/a1224
242015KIASOUL EVSTATION WAGON - SMALLB17.522.719.922.62.20n/an/a1494
252015MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
262015NISSANLEAFMID-SIZEB16.520.818.41.92.32.10n/an/a1355
272015SMARTFORTWO ELECTRIC DRIVE CABRIOLETTWO-SEATERB17.222.519.61.92.52.20n/an/a1098
282015SMARTFORTWO ELECTRIC DRIVE COUPETWO-SEATERB17.222.519.61.92.52.20n/an/a1098
292015TESLAMODEL S (60 kWh battery)FULL-SIZEB22.221.721.92.52.42.50n/an/a33510
...................................................
542016TESLAMODEL S P85D/P90DFULL-SIZEB23.421.522.52.62.42.5010n/a40712
552016TESLAMODEL S P90D (Refresh)FULL-SIZEB22.92122.12.62.42.5010n/a43512
562016TESLAMODEL S P100DFULL-SIZEB22.62021.52.52.32.4010n/a50712
572016TESLAMODEL X 60DSUV - STANDARDB2322.222.62.62.52.5010n/a32210
582016TESLAMODEL X 75DSUV - STANDARDB2321.922.52.62.52.5010n/a38312
592016TESLAMODEL X 90DSUV - STANDARDB23.222.222.72.62.52.6010n/a41412
602016TESLAMODEL X P90DSUV - STANDARDB23.623.323.52.72.62.6010n/a40212
612016TESLAMODEL X P100DSUV - STANDARDB25.722.924.42.92.62.7010n/a46512
622017BMWi3 (60 Ah)SUBCOMPACTB15.218.816.81.72.11.9010101304
632017BMWi3 (94 Ah)SUBCOMPACTB16.219.717.81.82.22010101835
642017CHEVROLETBOLT EVSTATION WAGON - SMALLB16.41917.61.82.12010103839.3
652017FORDFOCUS ELECTRICCOMPACTB17.721.819.622.52.2010101855.5
662017KIASOUL EVSTATION WAGON - SMALLB17.42319.922.62.2010101504
672017MITSUBISHIi-MiEVSUBCOMPACTB16.920.518.71.92.32.1010101007
682017NISSANLEAFMID-SIZEB1720.718.61.92.32.1010101726
692017TESLAMODEL S (60 kWh battery)FULL-SIZEB21.520.721.12.42.32.40101033810
702017TESLAMODEL S (75 kWh battery)FULL-SIZEB21.52121.32.42.42.40101040112
712017TESLAMODEL S 60DFULL-SIZEB20.619.620.22.32.22.30101035110
722017TESLAMODEL S 75DFULL-SIZEB20.619.920.32.32.22.30101041712
732017TESLAMODEL S 90DFULL-SIZEB20.619.720.22.32.22.30101047312
742017TESLAMODEL S 100DFULL-SIZEB20.720.520.62.32.32.30101053912
752017TESLAMODEL S P90DFULL-SIZEB22.820.9222.62.32.50101043512
762017TESLAMODEL S P100DFULL-SIZEB22.62021.52.52.32.40101050712
772017TESLAMODEL X 60DSUV - STANDARDB2322.222.62.62.52.50101032210
782017TESLAMODEL X 75DSUV - STANDARDB2321.922.52.62.52.50101038312
792017TESLAMODEL X 90DSUV - STANDARDB23.222.222.72.62.52.60101041412
802017TESLAMODEL X 100DSUV - STANDARDB24.323.7242.72.72.70101047512
812017TESLAMODEL X P90DSUV - STANDARDB23.623.323.52.72.62.60101040212
822017TESLAMODEL X P100DSUV - STANDARDB25.722.924.42.92.62.70101046512
832017VOLKSWAGENe-GOLFCOMPACTB16.818.617.41.92.12010102015.3
\n", - "

84 rows × 16 columns

\n", - "
" - ], - "text/plain": [ - " year make model vclass \\\n", - "0 YEAR NaN NaN NaN \n", - "1 2012 MITSUBISHI i-MiEV SUBCOMPACT \n", - "2 2012 NISSAN LEAF MID-SIZE \n", - "3 2013 FORD FOCUS ELECTRIC COMPACT \n", - "4 2013 MITSUBISHI i-MiEV SUBCOMPACT \n", - "5 2013 NISSAN LEAF MID-SIZE \n", - "6 2013 SMART FORTWO ELECTRIC DRIVE CABRIOLET TWO-SEATER \n", - "7 2013 SMART FORTWO ELECTRIC DRIVE COUPE TWO-SEATER \n", - "8 2013 TESLA MODEL S (40 kWh battery) FULL-SIZE \n", - "9 2013 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "10 2013 TESLA MODEL S (85 kWh battery) FULL-SIZE \n", - "11 2013 TESLA MODEL S PERFORMANCE FULL-SIZE \n", - "12 2014 CHEVROLET SPARK EV SUBCOMPACT \n", - "13 2014 FORD FOCUS ELECTRIC COMPACT \n", - "14 2014 MITSUBISHI i-MiEV SUBCOMPACT \n", - "15 2014 NISSAN LEAF MID-SIZE \n", - "16 2014 SMART FORTWO ELECTRIC DRIVE CABRIOLET TWO-SEATER \n", - "17 2014 SMART FORTWO ELECTRIC DRIVE COUPE TWO-SEATER \n", - "18 2014 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "19 2014 TESLA MODEL S (85 kWh battery) FULL-SIZE \n", - "20 2014 TESLA MODEL S PERFORMANCE FULL-SIZE \n", - "21 2015 BMW i3 SUBCOMPACT \n", - "22 2015 CHEVROLET SPARK EV SUBCOMPACT \n", - "23 2015 FORD FOCUS ELECTRIC COMPACT \n", - "24 2015 KIA SOUL EV STATION WAGON - SMALL \n", - "25 2015 MITSUBISHI i-MiEV SUBCOMPACT \n", - "26 2015 NISSAN LEAF MID-SIZE \n", - "27 2015 SMART FORTWO ELECTRIC DRIVE CABRIOLET TWO-SEATER \n", - "28 2015 SMART FORTWO ELECTRIC DRIVE COUPE TWO-SEATER \n", - "29 2015 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - ".. ... ... ... ... \n", - "54 2016 TESLA MODEL S P85D/P90D FULL-SIZE \n", - "55 2016 TESLA MODEL S P90D (Refresh) FULL-SIZE \n", - "56 2016 TESLA MODEL S P100D FULL-SIZE \n", - "57 2016 TESLA MODEL X 60D SUV - STANDARD \n", - "58 2016 TESLA MODEL X 75D SUV - STANDARD \n", - "59 2016 TESLA MODEL X 90D SUV - STANDARD \n", - "60 2016 TESLA MODEL X P90D SUV - STANDARD \n", - "61 2016 TESLA MODEL X P100D SUV - STANDARD \n", - "62 2017 BMW i3 (60 Ah) SUBCOMPACT \n", - "63 2017 BMW i3 (94 Ah) SUBCOMPACT \n", - "64 2017 CHEVROLET BOLT EV STATION WAGON - SMALL \n", - "65 2017 FORD FOCUS ELECTRIC COMPACT \n", - "66 2017 KIA SOUL EV STATION WAGON - SMALL \n", - "67 2017 MITSUBISHI i-MiEV SUBCOMPACT \n", - "68 2017 NISSAN LEAF MID-SIZE \n", - "69 2017 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "70 2017 TESLA MODEL S (75 kWh battery) FULL-SIZE \n", - "71 2017 TESLA MODEL S 60D FULL-SIZE \n", - "72 2017 TESLA MODEL S 75D FULL-SIZE \n", - "73 2017 TESLA MODEL S 90D FULL-SIZE \n", - "74 2017 TESLA MODEL S 100D FULL-SIZE \n", - "75 2017 TESLA MODEL S P90D FULL-SIZE \n", - "76 2017 TESLA MODEL S P100D FULL-SIZE \n", - "77 2017 TESLA MODEL X 60D SUV - STANDARD \n", - "78 2017 TESLA MODEL X 75D SUV - STANDARD \n", - "79 2017 TESLA MODEL X 90D SUV - STANDARD \n", - "80 2017 TESLA MODEL X 100D SUV - STANDARD \n", - "81 2017 TESLA MODEL X P90D SUV - STANDARD \n", - "82 2017 TESLA MODEL X P100D SUV - STANDARD \n", - "83 2017 VOLKSWAGEN e-GOLF COMPACT \n", - "\n", - " fuel cityElec hwyElec combElec \\\n", - "0 TYPE CITY (kWh/100 km) HWY (kWh/100 km) COMB (kWh/100 km) \n", - "1 B 16.9 21.4 18.7 \n", - "2 B 19.3 23 21.1 \n", - "3 B 19 21.1 20 \n", - "4 B 16.9 21.4 18.7 \n", - "5 B 19.3 23 21.1 \n", - "6 B 17.2 22.5 19.6 \n", - "7 B 17.2 22.5 19.6 \n", - "8 B 22.4 21.9 22.2 \n", - "9 B 22.2 21.7 21.9 \n", - "10 B 23.8 23.2 23.6 \n", - "11 B 23.9 23.2 23.6 \n", - "12 B 16 19.6 17.8 \n", - "13 B 19 21.1 20 \n", - "14 B 16.9 21.4 18.7 \n", - "15 B 16.5 20.8 18.4 \n", - "16 B 17.2 22.5 19.6 \n", - "17 B 17.2 22.5 19.6 \n", - "18 B 22.2 21.7 21.9 \n", - "19 B 23.8 23.2 23.6 \n", - "20 B 23.9 23.2 23.6 \n", - "21 B 15.2 18.8 16.8 \n", - "22 B 16 19.6 17.8 \n", - "23 B 19 21.1 20 \n", - "24 B 17.5 22.7 19.9 \n", - "25 B 16.9 21.4 18.7 \n", - "26 B 16.5 20.8 18.4 \n", - "27 B 17.2 22.5 19.6 \n", - "28 B 17.2 22.5 19.6 \n", - "29 B 22.2 21.7 21.9 \n", - ".. ... ... ... ... \n", - "54 B 23.4 21.5 22.5 \n", - "55 B 22.9 21 22.1 \n", - "56 B 22.6 20 21.5 \n", - "57 B 23 22.2 22.6 \n", - "58 B 23 21.9 22.5 \n", - "59 B 23.2 22.2 22.7 \n", - "60 B 23.6 23.3 23.5 \n", - "61 B 25.7 22.9 24.4 \n", - "62 B 15.2 18.8 16.8 \n", - "63 B 16.2 19.7 17.8 \n", - "64 B 16.4 19 17.6 \n", - "65 B 17.7 21.8 19.6 \n", - "66 B 17.4 23 19.9 \n", - "67 B 16.9 20.5 18.7 \n", - "68 B 17 20.7 18.6 \n", - "69 B 21.5 20.7 21.1 \n", - "70 B 21.5 21 21.3 \n", - "71 B 20.6 19.6 20.2 \n", - "72 B 20.6 19.9 20.3 \n", - "73 B 20.6 19.7 20.2 \n", - "74 B 20.7 20.5 20.6 \n", - "75 B 22.8 20.9 22 \n", - "76 B 22.6 20 21.5 \n", - "77 B 23 22.2 22.6 \n", - "78 B 23 21.9 22.5 \n", - "79 B 23.2 22.2 22.7 \n", - "80 B 24.3 23.7 24 \n", - "81 B 23.6 23.3 23.5 \n", - "82 B 25.7 22.9 24.4 \n", - "83 B 16.8 18.6 17.4 \n", - "\n", - " cityGas hwyGas combGas co2 co2Rate \\\n", - "0 CITY (Le/100 km) HWY (Le/100 km) COMB (Le/100 km) (g/km) RATING \n", - "1 1.9 2.4 2.1 0 n/a \n", - "2 2.2 2.6 2.4 0 n/a \n", - "3 2.1 2.4 2.2 0 n/a \n", - "4 1.9 2.4 2.1 0 n/a \n", - "5 2.2 2.6 2.4 0 n/a \n", - "6 1.9 2.5 2.2 0 n/a \n", - "7 1.9 2.5 2.2 0 n/a \n", - "8 2.5 2.5 2.5 0 n/a \n", - "9 2.5 2.4 2.5 0 n/a \n", - "10 2.7 2.6 2.6 0 n/a \n", - "11 2.7 2.6 2.6 0 n/a \n", - "12 1.8 2.2 2 0 n/a \n", - "13 2.1 2.4 2.2 0 n/a \n", - "14 1.9 2.4 2.1 0 n/a \n", - "15 1.9 2.3 2.1 0 n/a \n", - "16 1.9 2.5 2.2 0 n/a \n", - "17 1.9 2.5 2.2 0 n/a \n", - "18 2.5 2.4 2.5 0 n/a \n", - "19 2.7 2.6 2.6 0 n/a \n", - "20 2.7 2.6 2.6 0 n/a \n", - "21 1.7 2.1 1.9 0 n/a \n", - "22 1.8 2.2 2 0 n/a \n", - "23 2.1 2.4 2.2 0 n/a \n", - "24 2 2.6 2.2 0 n/a \n", - "25 1.9 2.4 2.1 0 n/a \n", - "26 1.9 2.3 2.1 0 n/a \n", - "27 1.9 2.5 2.2 0 n/a \n", - "28 1.9 2.5 2.2 0 n/a \n", - "29 2.5 2.4 2.5 0 n/a \n", - ".. ... ... ... ... ... \n", - "54 2.6 2.4 2.5 0 10 \n", - "55 2.6 2.4 2.5 0 10 \n", - "56 2.5 2.3 2.4 0 10 \n", - "57 2.6 2.5 2.5 0 10 \n", - "58 2.6 2.5 2.5 0 10 \n", - "59 2.6 2.5 2.6 0 10 \n", - "60 2.7 2.6 2.6 0 10 \n", - "61 2.9 2.6 2.7 0 10 \n", - "62 1.7 2.1 1.9 0 10 \n", - "63 1.8 2.2 2 0 10 \n", - "64 1.8 2.1 2 0 10 \n", - "65 2 2.5 2.2 0 10 \n", - "66 2 2.6 2.2 0 10 \n", - "67 1.9 2.3 2.1 0 10 \n", - "68 1.9 2.3 2.1 0 10 \n", - "69 2.4 2.3 2.4 0 10 \n", - "70 2.4 2.4 2.4 0 10 \n", - "71 2.3 2.2 2.3 0 10 \n", - "72 2.3 2.2 2.3 0 10 \n", - "73 2.3 2.2 2.3 0 10 \n", - "74 2.3 2.3 2.3 0 10 \n", - "75 2.6 2.3 2.5 0 10 \n", - "76 2.5 2.3 2.4 0 10 \n", - "77 2.6 2.5 2.5 0 10 \n", - "78 2.6 2.5 2.5 0 10 \n", - "79 2.6 2.5 2.6 0 10 \n", - "80 2.7 2.7 2.7 0 10 \n", - "81 2.7 2.6 2.6 0 10 \n", - "82 2.9 2.6 2.7 0 10 \n", - "83 1.9 2.1 2 0 10 \n", - "\n", - " smogRate dist recharge \n", - "0 RATING (km) TIME (h) \n", - "1 n/a 100 7 \n", - "2 n/a 117 7 \n", - "3 n/a 122 4 \n", - "4 n/a 100 7 \n", - "5 n/a 117 7 \n", - "6 n/a 109 8 \n", - "7 n/a 109 8 \n", - "8 n/a 224 6 \n", - "9 n/a 335 10 \n", - "10 n/a 426 12 \n", - "11 n/a 426 12 \n", - "12 n/a 131 7 \n", - "13 n/a 122 4 \n", - "14 n/a 100 7 \n", - "15 n/a 135 5 \n", - "16 n/a 109 8 \n", - "17 n/a 109 8 \n", - "18 n/a 335 10 \n", - "19 n/a 426 12 \n", - "20 n/a 426 12 \n", - "21 n/a 130 4 \n", - "22 n/a 131 7 \n", - "23 n/a 122 4 \n", - "24 n/a 149 4 \n", - "25 n/a 100 7 \n", - "26 n/a 135 5 \n", - "27 n/a 109 8 \n", - "28 n/a 109 8 \n", - "29 n/a 335 10 \n", - ".. ... ... ... \n", - "54 n/a 407 12 \n", - "55 n/a 435 12 \n", - "56 n/a 507 12 \n", - "57 n/a 322 10 \n", - "58 n/a 383 12 \n", - "59 n/a 414 12 \n", - "60 n/a 402 12 \n", - "61 n/a 465 12 \n", - "62 10 130 4 \n", - "63 10 183 5 \n", - "64 10 383 9.3 \n", - "65 10 185 5.5 \n", - "66 10 150 4 \n", - "67 10 100 7 \n", - "68 10 172 6 \n", - "69 10 338 10 \n", - "70 10 401 12 \n", - "71 10 351 10 \n", - "72 10 417 12 \n", - "73 10 473 12 \n", - "74 10 539 12 \n", - "75 10 435 12 \n", - "76 10 507 12 \n", - "77 10 322 10 \n", - "78 10 383 12 \n", - "79 10 414 12 \n", - "80 10 475 12 \n", - "81 10 402 12 \n", - "82 10 465 12 \n", - "83 10 201 5.3 \n", - "\n", - "[84 rows x 16 columns]" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "newcols = {'MODEL': 'year', 'MAKE':'make', 'MODEL.1':'model', 'VEHICLE CLASS':'vclass', 'FUEL':'fuel', 'CONSUMPTION':'cityElec', 'Unnamed: 8':'hwyElec', 'Unnamed: 9':'combElec',\n", - " 'Unnamed: 10':'cityGas', 'Unnamed: 11':'hwyGas', 'Unnamed: 12':'combGas', 'CO2 EMISSIONS':'co2', 'CO2 ':'co2Rate', 'SMOG':'smogRate', 'RANGE':'dist', u'RECHARGE':'recharge'}\n", - "elec.rename(columns=newcols, inplace=True)\n", - "elec" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
yearmakemodelvclassfuelcityElechwyEleccombEleccityGashwyGascombGasco2co2RatesmogRatedistrecharge
12012MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
22012NISSANLEAFMID-SIZEB19.32321.12.22.62.40n/an/a1177
32013FORDFOCUS ELECTRICCOMPACTB1921.1202.12.42.20n/an/a1224
42013MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
52013NISSANLEAFMID-SIZEB19.32321.12.22.62.40n/an/a1177
62013SMARTFORTWO ELECTRIC DRIVE CABRIOLETTWO-SEATERB17.222.519.61.92.52.20n/an/a1098
72013SMARTFORTWO ELECTRIC DRIVE COUPETWO-SEATERB17.222.519.61.92.52.20n/an/a1098
82013TESLAMODEL S (40 kWh battery)FULL-SIZEB22.421.922.22.52.52.50n/an/a2246
92013TESLAMODEL S (60 kWh battery)FULL-SIZEB22.221.721.92.52.42.50n/an/a33510
102013TESLAMODEL S (85 kWh battery)FULL-SIZEB23.823.223.62.72.62.60n/an/a42612
112013TESLAMODEL S PERFORMANCEFULL-SIZEB23.923.223.62.72.62.60n/an/a42612
122014CHEVROLETSPARK EVSUBCOMPACTB1619.617.81.82.220n/an/a1317
132014FORDFOCUS ELECTRICCOMPACTB1921.1202.12.42.20n/an/a1224
142014MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
152014NISSANLEAFMID-SIZEB16.520.818.41.92.32.10n/an/a1355
162014SMARTFORTWO ELECTRIC DRIVE CABRIOLETTWO-SEATERB17.222.519.61.92.52.20n/an/a1098
172014SMARTFORTWO ELECTRIC DRIVE COUPETWO-SEATERB17.222.519.61.92.52.20n/an/a1098
182014TESLAMODEL S (60 kWh battery)FULL-SIZEB22.221.721.92.52.42.50n/an/a33510
192014TESLAMODEL S (85 kWh battery)FULL-SIZEB23.823.223.62.72.62.60n/an/a42612
202014TESLAMODEL S PERFORMANCEFULL-SIZEB23.923.223.62.72.62.60n/an/a42612
212015BMWi3SUBCOMPACTB15.218.816.81.72.11.90n/an/a1304
222015CHEVROLETSPARK EVSUBCOMPACTB1619.617.81.82.220n/an/a1317
232015FORDFOCUS ELECTRICCOMPACTB1921.1202.12.42.20n/an/a1224
242015KIASOUL EVSTATION WAGON - SMALLB17.522.719.922.62.20n/an/a1494
252015MITSUBISHIi-MiEVSUBCOMPACTB16.921.418.71.92.42.10n/an/a1007
262015NISSANLEAFMID-SIZEB16.520.818.41.92.32.10n/an/a1355
272015SMARTFORTWO ELECTRIC DRIVE CABRIOLETTWO-SEATERB17.222.519.61.92.52.20n/an/a1098
282015SMARTFORTWO ELECTRIC DRIVE COUPETWO-SEATERB17.222.519.61.92.52.20n/an/a1098
292015TESLAMODEL S (60 kWh battery)FULL-SIZEB22.221.721.92.52.42.50n/an/a33510
302015TESLAMODEL S (70 kWh battery)FULL-SIZEB23.823.223.62.72.62.60n/an/a37712
...................................................
542016TESLAMODEL S P85D/P90DFULL-SIZEB23.421.522.52.62.42.5010n/a40712
552016TESLAMODEL S P90D (Refresh)FULL-SIZEB22.92122.12.62.42.5010n/a43512
562016TESLAMODEL S P100DFULL-SIZEB22.62021.52.52.32.4010n/a50712
572016TESLAMODEL X 60DSUV - STANDARDB2322.222.62.62.52.5010n/a32210
582016TESLAMODEL X 75DSUV - STANDARDB2321.922.52.62.52.5010n/a38312
592016TESLAMODEL X 90DSUV - STANDARDB23.222.222.72.62.52.6010n/a41412
602016TESLAMODEL X P90DSUV - STANDARDB23.623.323.52.72.62.6010n/a40212
612016TESLAMODEL X P100DSUV - STANDARDB25.722.924.42.92.62.7010n/a46512
622017BMWi3 (60 Ah)SUBCOMPACTB15.218.816.81.72.11.9010101304
632017BMWi3 (94 Ah)SUBCOMPACTB16.219.717.81.82.22010101835
642017CHEVROLETBOLT EVSTATION WAGON - SMALLB16.41917.61.82.12010103839.3
652017FORDFOCUS ELECTRICCOMPACTB17.721.819.622.52.2010101855.5
662017KIASOUL EVSTATION WAGON - SMALLB17.42319.922.62.2010101504
672017MITSUBISHIi-MiEVSUBCOMPACTB16.920.518.71.92.32.1010101007
682017NISSANLEAFMID-SIZEB1720.718.61.92.32.1010101726
692017TESLAMODEL S (60 kWh battery)FULL-SIZEB21.520.721.12.42.32.40101033810
702017TESLAMODEL S (75 kWh battery)FULL-SIZEB21.52121.32.42.42.40101040112
712017TESLAMODEL S 60DFULL-SIZEB20.619.620.22.32.22.30101035110
722017TESLAMODEL S 75DFULL-SIZEB20.619.920.32.32.22.30101041712
732017TESLAMODEL S 90DFULL-SIZEB20.619.720.22.32.22.30101047312
742017TESLAMODEL S 100DFULL-SIZEB20.720.520.62.32.32.30101053912
752017TESLAMODEL S P90DFULL-SIZEB22.820.9222.62.32.50101043512
762017TESLAMODEL S P100DFULL-SIZEB22.62021.52.52.32.40101050712
772017TESLAMODEL X 60DSUV - STANDARDB2322.222.62.62.52.50101032210
782017TESLAMODEL X 75DSUV - STANDARDB2321.922.52.62.52.50101038312
792017TESLAMODEL X 90DSUV - STANDARDB23.222.222.72.62.52.60101041412
802017TESLAMODEL X 100DSUV - STANDARDB24.323.7242.72.72.70101047512
812017TESLAMODEL X P90DSUV - STANDARDB23.623.323.52.72.62.60101040212
822017TESLAMODEL X P100DSUV - STANDARDB25.722.924.42.92.62.70101046512
832017VOLKSWAGENe-GOLFCOMPACTB16.818.617.41.92.12010102015.3
\n", - "

83 rows × 16 columns

\n", - "
" - ], - "text/plain": [ - " year make model vclass \\\n", - "1 2012 MITSUBISHI i-MiEV SUBCOMPACT \n", - "2 2012 NISSAN LEAF MID-SIZE \n", - "3 2013 FORD FOCUS ELECTRIC COMPACT \n", - "4 2013 MITSUBISHI i-MiEV SUBCOMPACT \n", - "5 2013 NISSAN LEAF MID-SIZE \n", - "6 2013 SMART FORTWO ELECTRIC DRIVE CABRIOLET TWO-SEATER \n", - "7 2013 SMART FORTWO ELECTRIC DRIVE COUPE TWO-SEATER \n", - "8 2013 TESLA MODEL S (40 kWh battery) FULL-SIZE \n", - "9 2013 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "10 2013 TESLA MODEL S (85 kWh battery) FULL-SIZE \n", - "11 2013 TESLA MODEL S PERFORMANCE FULL-SIZE \n", - "12 2014 CHEVROLET SPARK EV SUBCOMPACT \n", - "13 2014 FORD FOCUS ELECTRIC COMPACT \n", - "14 2014 MITSUBISHI i-MiEV SUBCOMPACT \n", - "15 2014 NISSAN LEAF MID-SIZE \n", - "16 2014 SMART FORTWO ELECTRIC DRIVE CABRIOLET TWO-SEATER \n", - "17 2014 SMART FORTWO ELECTRIC DRIVE COUPE TWO-SEATER \n", - "18 2014 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "19 2014 TESLA MODEL S (85 kWh battery) FULL-SIZE \n", - "20 2014 TESLA MODEL S PERFORMANCE FULL-SIZE \n", - "21 2015 BMW i3 SUBCOMPACT \n", - "22 2015 CHEVROLET SPARK EV SUBCOMPACT \n", - "23 2015 FORD FOCUS ELECTRIC COMPACT \n", - "24 2015 KIA SOUL EV STATION WAGON - SMALL \n", - "25 2015 MITSUBISHI i-MiEV SUBCOMPACT \n", - "26 2015 NISSAN LEAF MID-SIZE \n", - "27 2015 SMART FORTWO ELECTRIC DRIVE CABRIOLET TWO-SEATER \n", - "28 2015 SMART FORTWO ELECTRIC DRIVE COUPE TWO-SEATER \n", - "29 2015 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "30 2015 TESLA MODEL S (70 kWh battery) FULL-SIZE \n", - ".. ... ... ... ... \n", - "54 2016 TESLA MODEL S P85D/P90D FULL-SIZE \n", - "55 2016 TESLA MODEL S P90D (Refresh) FULL-SIZE \n", - "56 2016 TESLA MODEL S P100D FULL-SIZE \n", - "57 2016 TESLA MODEL X 60D SUV - STANDARD \n", - "58 2016 TESLA MODEL X 75D SUV - STANDARD \n", - "59 2016 TESLA MODEL X 90D SUV - STANDARD \n", - "60 2016 TESLA MODEL X P90D SUV - STANDARD \n", - "61 2016 TESLA MODEL X P100D SUV - STANDARD \n", - "62 2017 BMW i3 (60 Ah) SUBCOMPACT \n", - "63 2017 BMW i3 (94 Ah) SUBCOMPACT \n", - "64 2017 CHEVROLET BOLT EV STATION WAGON - SMALL \n", - "65 2017 FORD FOCUS ELECTRIC COMPACT \n", - "66 2017 KIA SOUL EV STATION WAGON - SMALL \n", - "67 2017 MITSUBISHI i-MiEV SUBCOMPACT \n", - "68 2017 NISSAN LEAF MID-SIZE \n", - "69 2017 TESLA MODEL S (60 kWh battery) FULL-SIZE \n", - "70 2017 TESLA MODEL S (75 kWh battery) FULL-SIZE \n", - "71 2017 TESLA MODEL S 60D FULL-SIZE \n", - "72 2017 TESLA MODEL S 75D FULL-SIZE \n", - "73 2017 TESLA MODEL S 90D FULL-SIZE \n", - "74 2017 TESLA MODEL S 100D FULL-SIZE \n", - "75 2017 TESLA MODEL S P90D FULL-SIZE \n", - "76 2017 TESLA MODEL S P100D FULL-SIZE \n", - "77 2017 TESLA MODEL X 60D SUV - STANDARD \n", - "78 2017 TESLA MODEL X 75D SUV - STANDARD \n", - "79 2017 TESLA MODEL X 90D SUV - STANDARD \n", - "80 2017 TESLA MODEL X 100D SUV - STANDARD \n", - "81 2017 TESLA MODEL X P90D SUV - STANDARD \n", - "82 2017 TESLA MODEL X P100D SUV - STANDARD \n", - "83 2017 VOLKSWAGEN e-GOLF COMPACT \n", - "\n", - " fuel cityElec hwyElec combElec cityGas hwyGas combGas co2 co2Rate smogRate \\\n", - "1 B 16.9 21.4 18.7 1.9 2.4 2.1 0 n/a n/a \n", - "2 B 19.3 23 21.1 2.2 2.6 2.4 0 n/a n/a \n", - "3 B 19 21.1 20 2.1 2.4 2.2 0 n/a n/a \n", - "4 B 16.9 21.4 18.7 1.9 2.4 2.1 0 n/a n/a \n", - "5 B 19.3 23 21.1 2.2 2.6 2.4 0 n/a n/a \n", - "6 B 17.2 22.5 19.6 1.9 2.5 2.2 0 n/a n/a \n", - "7 B 17.2 22.5 19.6 1.9 2.5 2.2 0 n/a n/a \n", - "8 B 22.4 21.9 22.2 2.5 2.5 2.5 0 n/a n/a \n", - "9 B 22.2 21.7 21.9 2.5 2.4 2.5 0 n/a n/a \n", - "10 B 23.8 23.2 23.6 2.7 2.6 2.6 0 n/a n/a \n", - "11 B 23.9 23.2 23.6 2.7 2.6 2.6 0 n/a n/a \n", - "12 B 16 19.6 17.8 1.8 2.2 2 0 n/a n/a \n", - "13 B 19 21.1 20 2.1 2.4 2.2 0 n/a n/a \n", - "14 B 16.9 21.4 18.7 1.9 2.4 2.1 0 n/a n/a \n", - "15 B 16.5 20.8 18.4 1.9 2.3 2.1 0 n/a n/a \n", - "16 B 17.2 22.5 19.6 1.9 2.5 2.2 0 n/a n/a \n", - "17 B 17.2 22.5 19.6 1.9 2.5 2.2 0 n/a n/a \n", - "18 B 22.2 21.7 21.9 2.5 2.4 2.5 0 n/a n/a \n", - "19 B 23.8 23.2 23.6 2.7 2.6 2.6 0 n/a n/a \n", - "20 B 23.9 23.2 23.6 2.7 2.6 2.6 0 n/a n/a \n", - "21 B 15.2 18.8 16.8 1.7 2.1 1.9 0 n/a n/a \n", - "22 B 16 19.6 17.8 1.8 2.2 2 0 n/a n/a \n", - "23 B 19 21.1 20 2.1 2.4 2.2 0 n/a n/a \n", - "24 B 17.5 22.7 19.9 2 2.6 2.2 0 n/a n/a \n", - "25 B 16.9 21.4 18.7 1.9 2.4 2.1 0 n/a n/a \n", - "26 B 16.5 20.8 18.4 1.9 2.3 2.1 0 n/a n/a \n", - "27 B 17.2 22.5 19.6 1.9 2.5 2.2 0 n/a n/a \n", - "28 B 17.2 22.5 19.6 1.9 2.5 2.2 0 n/a n/a \n", - "29 B 22.2 21.7 21.9 2.5 2.4 2.5 0 n/a n/a \n", - "30 B 23.8 23.2 23.6 2.7 2.6 2.6 0 n/a n/a \n", - ".. ... ... ... ... ... ... ... .. ... ... \n", - "54 B 23.4 21.5 22.5 2.6 2.4 2.5 0 10 n/a \n", - "55 B 22.9 21 22.1 2.6 2.4 2.5 0 10 n/a \n", - "56 B 22.6 20 21.5 2.5 2.3 2.4 0 10 n/a \n", - "57 B 23 22.2 22.6 2.6 2.5 2.5 0 10 n/a \n", - "58 B 23 21.9 22.5 2.6 2.5 2.5 0 10 n/a \n", - "59 B 23.2 22.2 22.7 2.6 2.5 2.6 0 10 n/a \n", - "60 B 23.6 23.3 23.5 2.7 2.6 2.6 0 10 n/a \n", - "61 B 25.7 22.9 24.4 2.9 2.6 2.7 0 10 n/a \n", - "62 B 15.2 18.8 16.8 1.7 2.1 1.9 0 10 10 \n", - "63 B 16.2 19.7 17.8 1.8 2.2 2 0 10 10 \n", - "64 B 16.4 19 17.6 1.8 2.1 2 0 10 10 \n", - "65 B 17.7 21.8 19.6 2 2.5 2.2 0 10 10 \n", - "66 B 17.4 23 19.9 2 2.6 2.2 0 10 10 \n", - "67 B 16.9 20.5 18.7 1.9 2.3 2.1 0 10 10 \n", - "68 B 17 20.7 18.6 1.9 2.3 2.1 0 10 10 \n", - "69 B 21.5 20.7 21.1 2.4 2.3 2.4 0 10 10 \n", - "70 B 21.5 21 21.3 2.4 2.4 2.4 0 10 10 \n", - "71 B 20.6 19.6 20.2 2.3 2.2 2.3 0 10 10 \n", - "72 B 20.6 19.9 20.3 2.3 2.2 2.3 0 10 10 \n", - "73 B 20.6 19.7 20.2 2.3 2.2 2.3 0 10 10 \n", - "74 B 20.7 20.5 20.6 2.3 2.3 2.3 0 10 10 \n", - "75 B 22.8 20.9 22 2.6 2.3 2.5 0 10 10 \n", - "76 B 22.6 20 21.5 2.5 2.3 2.4 0 10 10 \n", - "77 B 23 22.2 22.6 2.6 2.5 2.5 0 10 10 \n", - "78 B 23 21.9 22.5 2.6 2.5 2.5 0 10 10 \n", - "79 B 23.2 22.2 22.7 2.6 2.5 2.6 0 10 10 \n", - "80 B 24.3 23.7 24 2.7 2.7 2.7 0 10 10 \n", - "81 B 23.6 23.3 23.5 2.7 2.6 2.6 0 10 10 \n", - "82 B 25.7 22.9 24.4 2.9 2.6 2.7 0 10 10 \n", - "83 B 16.8 18.6 17.4 1.9 2.1 2 0 10 10 \n", - "\n", - " dist recharge \n", - "1 100 7 \n", - "2 117 7 \n", - "3 122 4 \n", - "4 100 7 \n", - "5 117 7 \n", - "6 109 8 \n", - "7 109 8 \n", - "8 224 6 \n", - "9 335 10 \n", - "10 426 12 \n", - "11 426 12 \n", - "12 131 7 \n", - "13 122 4 \n", - "14 100 7 \n", - "15 135 5 \n", - "16 109 8 \n", - "17 109 8 \n", - "18 335 10 \n", - "19 426 12 \n", - "20 426 12 \n", - "21 130 4 \n", - "22 131 7 \n", - "23 122 4 \n", - "24 149 4 \n", - "25 100 7 \n", - "26 135 5 \n", - "27 109 8 \n", - "28 109 8 \n", - "29 335 10 \n", - "30 377 12 \n", - ".. ... ... \n", - "54 407 12 \n", - "55 435 12 \n", - "56 507 12 \n", - "57 322 10 \n", - "58 383 12 \n", - "59 414 12 \n", - "60 402 12 \n", - "61 465 12 \n", - "62 130 4 \n", - "63 183 5 \n", - "64 383 9.3 \n", - "65 185 5.5 \n", - "66 150 4 \n", - "67 100 7 \n", - "68 172 6 \n", - "69 338 10 \n", - "70 401 12 \n", - "71 351 10 \n", - "72 417 12 \n", - "73 473 12 \n", - "74 539 12 \n", - "75 435 12 \n", - "76 507 12 \n", - "77 322 10 \n", - "78 383 12 \n", - "79 414 12 \n", - "80 475 12 \n", - "81 402 12 \n", - "82 465 12 \n", - "83 201 5.3 \n", - "\n", - "[83 rows x 16 columns]" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "elec = elec.drop(elec.index[0])\n", - "elec" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
yearmakemodelvclassfuelcityElechwyEleccombEleccityGashwyGascombGasco2co2RatesmogRatedistrecharge
count83838383838383838383838383838383
unique610407132282912791223310
top2016TESLAi-MiEVFULL-SIZEB17.222.519.61.92.42.2010n/a10912
freq273763483889201816834961834
\n", - "
" - ], - "text/plain": [ - " year make model vclass fuel cityElec hwyElec combElec cityGas \\\n", - "count 83 83 83 83 83 83 83 83 83 \n", - "unique 6 10 40 7 1 32 28 29 12 \n", - "top 2016 TESLA i-MiEV FULL-SIZE B 17.2 22.5 19.6 1.9 \n", - "freq 27 37 6 34 83 8 8 9 20 \n", - "\n", - " hwyGas combGas co2 co2Rate smogRate dist recharge \n", - "count 83 83 83 83 83 83 83 \n", - "unique 7 9 1 2 2 33 10 \n", - "top 2.4 2.2 0 10 n/a 109 12 \n", - "freq 18 16 83 49 61 8 34 " - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "elec.describe()" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "array(['SUBCOMPACT', 'MID-SIZE', 'COMPACT', 'TWO-SEATER', 'FULL-SIZE',\n", - " 'STATION WAGON - SMALL', 'SUV - STANDARD'], dtype=object)" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "elec.vclass.unique()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Understanding the Table\tfor normal cars\t\t\t\t\t\t\t\t\t\t\t\n", - "Model\t4WD/4X4 = Four-wheel drive\t\t\t\t\t\t\t\t\t\t\t\n", - "\tAWD = All-wheel drive\t\t\t\t\t\t\t\t\t\t\t\n", - "\tCNG = Compressed natural gas\t\t\t\t\t\t\t\t\t\t\t\n", - "\tFFV = Flexible-fuel vehicle\t\t\t\t\t\t\t\t\t\t\t\n", - "\tNGV = Natural gas vehicle\t\t\t\t\t\t\t\t\t\t\t\n", - "\t# = High output engine that provides more power than the standard engine of the same size\t\t\t\t\t\t\t\t\t\t\t\n", - "Transmission\tA = Automatic\t\t\t\t\t\t\t\t\t\t\t\n", - "\tAM = Automated manual\t\t\t\t\t\t\t\t\t\t\t\n", - "\tAS = Automatic with select shift\t\t\t\t\t\t\t\t\t\t\t\n", - "\tAV = Continuously variable\t\t\t\t\t\t\t\t\t\t\t\n", - "\tM = Manual\t\t\t\t\t\t\t\t\t\t\t\n", - "\t3 – 10 = Number of gears\t\t\t\t\t\t\t\t\t\t\t\n", - "Fuel Type\tX = Regular gasoline\t\t\t\t\t\t\t\t\t\t\t\n", - "\tZ = Premium gasoline\t\t\t\t\t\t\t\t\t\t\t\n", - "\tD = Diesel\t\t\t\t\t\t\t\t\t\t\t\n", - "\tE = Ethanol (E85)\t\t\t\t\t\t\t\t\t\t\t\n", - "\tN = Natural Gas\t\t\t\t\t\t\t\t\t\t\t\n", - "Fuel Consumption\tCity and highway fuel consumption ratings are shown in litres per 100 kilometres (L/100 km) - combined rating (55% city, 45% hwy) is shown in L/100 km and in miles per imperial gallon (mpg)\t\t\t\t\t\t\t\t\t\t\t\n", - "CO2 Emissions (g/km)\tEstimated tailpipe carbon dioxide emissions (in grams per kilometre) are based on fuel type and the combined fuel consumption rating.\t\t\t\t\t\t\t\t\t\t\t\n" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
MODELMAKEMODEL.1VEHICLE CLASSENGINE SIZECYLINDERSTRANSMISSIONFUELFUEL CONSUMPTIONUnnamed: 9Unnamed: 10Unnamed: 11CO2 EMISSIONS
02000ACURA1.6ELCOMPACT1.64A4X9.26.78.135186
12000ACURA1.6ELCOMPACT1.64M5X8.56.57.637175
22000ACURA3.2TLMID-SIZE3.26AS5Z12.27.410.028230
32000ACURA3.5RLMID-SIZE3.56A4Z13.49.211.525264
42000ACURAINTEGRASUBCOMPACT1.84A4X10.07.08.633198
\n", - "
" - ], - "text/plain": [ - " MODEL MAKE MODEL.1 VEHICLE CLASS ENGINE SIZE CYLINDERS TRANSMISSION \\\n", - "0 2000 ACURA 1.6EL COMPACT 1.6 4 A4 \n", - "1 2000 ACURA 1.6EL COMPACT 1.6 4 M5 \n", - "2 2000 ACURA 3.2TL MID-SIZE 3.2 6 AS5 \n", - "3 2000 ACURA 3.5RL MID-SIZE 3.5 6 A4 \n", - "4 2000 ACURA INTEGRA SUBCOMPACT 1.8 4 A4 \n", - "\n", - " FUEL FUEL CONSUMPTION Unnamed: 9 Unnamed: 10 Unnamed: 11 CO2 EMISSIONS \n", - "0 X 9.2 6.7 8.1 35 186 \n", - "1 X 8.5 6.5 7.6 37 175 \n", - "2 Z 12.2 7.4 10.0 28 230 \n", - "3 Z 13.4 9.2 11.5 25 264 \n", - "4 X 10.0 7.0 8.6 33 198 " - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df = pd.read_csv(\"fuel consumption dataset\\Original MY2000-2014 Fuel Consumption Ratings (2-cycle).csv\")\n", - "# take a look at the dataset\n", - "df.head()" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "Index(['MODEL', 'MAKE', 'MODEL.1', 'VEHICLE CLASS', 'ENGINE SIZE', 'CYLINDERS',\n", - " 'TRANSMISSION', 'FUEL', 'FUEL CONSUMPTION', 'Unnamed: 9', 'Unnamed: 10',\n", - " 'Unnamed: 11', 'CO2 EMISSIONS'],\n", - " dtype='object')" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df.columns" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
MODELENGINE SIZECYLINDERSFUEL CONSUMPTIONUnnamed: 9Unnamed: 10Unnamed: 11CO2 EMISSIONS
count14339.00000014339.00000014339.00000014339.00000014339.00000014339.00000014339.00000014339.000000
mean2007.6213823.4746085.98960912.9163478.81678611.07313627.346189248.566357
std4.1396291.3109351.7762143.5480032.3435512.9755667.49208759.113973
min2000.0000000.8000002.0000003.5000003.2000003.60000011.00000083.000000
25%2004.0000002.4000004.00000010.6000007.2000009.10000022.000000209.000000
50%2008.0000003.4000006.00000012.4000008.30000010.50000027.000000239.000000
75%2011.0000004.3000008.00000014.90000010.20000012.80000031.000000285.000000
max2014.0000008.40000016.00000030.60000019.00000024.80000078.000000570.000000
\n", - "
" - ], - "text/plain": [ - " MODEL ENGINE SIZE CYLINDERS FUEL CONSUMPTION \\\n", - "count 14339.000000 14339.000000 14339.000000 14339.000000 \n", - "mean 2007.621382 3.474608 5.989609 12.916347 \n", - "std 4.139629 1.310935 1.776214 3.548003 \n", - "min 2000.000000 0.800000 2.000000 3.500000 \n", - "25% 2004.000000 2.400000 4.000000 10.600000 \n", - "50% 2008.000000 3.400000 6.000000 12.400000 \n", - "75% 2011.000000 4.300000 8.000000 14.900000 \n", - "max 2014.000000 8.400000 16.000000 30.600000 \n", - "\n", - " Unnamed: 9 Unnamed: 10 Unnamed: 11 CO2 EMISSIONS \n", - "count 14339.000000 14339.000000 14339.000000 14339.000000 \n", - "mean 8.816786 11.073136 27.346189 248.566357 \n", - "std 2.343551 2.975566 7.492087 59.113973 \n", - "min 3.200000 3.600000 11.000000 83.000000 \n", - "25% 7.200000 9.100000 22.000000 209.000000 \n", - "50% 8.300000 10.500000 27.000000 239.000000 \n", - "75% 10.200000 12.800000 31.000000 285.000000 \n", - "max 19.000000 24.800000 78.000000 570.000000 " - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df.describe()" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
yearvclassco2
02000COMPACT175
12000MID-SIZE230
22000MID-SIZE264
32000SUBCOMPACT198
42000SUBCOMPACT189
52000SUBCOMPACT191
62000SUBCOMPACT267
72000SUBCOMPACT269
82000COMPACT218
92000COMPACT193
102000COMPACT248
112000COMPACT225
122000COMPACT232
132000COMPACT214
142000COMPACT255
152000COMPACT251
162000MID-SIZE258
172000STATION WAGON - MID-SIZE269
182000MID-SIZE264
192000MID-SIZE267
202000MID-SIZE269
212000MID-SIZE260
222000MID-SIZE269
232000MID-SIZE269
242000COMPACT264
252000COMPACT267
262000MINICOMPACT225
272000MINICOMPACT225
282000TWO-SEATER214
292000TWO-SEATER225
............
143082014COMPACT177
143092014COMPACT177
143102014COMPACT182
143112014COMPACT157
143122014COMPACT157
143132014COMPACT101
143142014MID-SIZE168
143152014MID-SIZE168
143162014MID-SIZE191
143172014MID-SIZE196
143182014MID-SIZE216
143192014MID-SIZE162
143202014MID-SIZE154
143212014MINIVAN242
143222014SUV - SMALL214
143232014SUV - SMALL232
143242014SUV - SMALL214
143252014SUV - STANDARD246
143262014SUV - STANDARD243
143272014COMPACT193
143282014COMPACT202
143292014COMPACT230
143302014MID-SIZE205
143312014MID-SIZE230
143322014SUV - SMALL223
143332014SUV - SMALL237
143342014SUV - SMALL230
143352014SUV - SMALL237
143362014SUV - SMALL225
143372014SUV - STANDARD258
\n", - "

14338 rows × 3 columns

\n", - "
" - ], - "text/plain": [ - " year vclass co2\n", - "0 2000 COMPACT 175\n", - "1 2000 MID-SIZE 230\n", - "2 2000 MID-SIZE 264\n", - "3 2000 SUBCOMPACT 198\n", - "4 2000 SUBCOMPACT 189\n", - "5 2000 SUBCOMPACT 191\n", - "6 2000 SUBCOMPACT 267\n", - "7 2000 SUBCOMPACT 269\n", - "8 2000 COMPACT 218\n", - "9 2000 COMPACT 193\n", - "10 2000 COMPACT 248\n", - "11 2000 COMPACT 225\n", - "12 2000 COMPACT 232\n", - "13 2000 COMPACT 214\n", - "14 2000 COMPACT 255\n", - "15 2000 COMPACT 251\n", - "16 2000 MID-SIZE 258\n", - "17 2000 STATION WAGON - MID-SIZE 269\n", - "18 2000 MID-SIZE 264\n", - "19 2000 MID-SIZE 267\n", - "20 2000 MID-SIZE 269\n", - "21 2000 MID-SIZE 260\n", - "22 2000 MID-SIZE 269\n", - "23 2000 MID-SIZE 269\n", - "24 2000 COMPACT 264\n", - "25 2000 COMPACT 267\n", - "26 2000 MINICOMPACT 225\n", - "27 2000 MINICOMPACT 225\n", - "28 2000 TWO-SEATER 214\n", - "29 2000 TWO-SEATER 225\n", - "... ... ... ...\n", - "14308 2014 COMPACT 177\n", - "14309 2014 COMPACT 177\n", - "14310 2014 COMPACT 182\n", - "14311 2014 COMPACT 157\n", - "14312 2014 COMPACT 157\n", - "14313 2014 COMPACT 101\n", - "14314 2014 MID-SIZE 168\n", - "14315 2014 MID-SIZE 168\n", - "14316 2014 MID-SIZE 191\n", - "14317 2014 MID-SIZE 196\n", - "14318 2014 MID-SIZE 216\n", - "14319 2014 MID-SIZE 162\n", - "14320 2014 MID-SIZE 154\n", - "14321 2014 MINIVAN 242\n", - "14322 2014 SUV - SMALL 214\n", - "14323 2014 SUV - SMALL 232\n", - "14324 2014 SUV - SMALL 214\n", - "14325 2014 SUV - STANDARD 246\n", - "14326 2014 SUV - STANDARD 243\n", - "14327 2014 COMPACT 193\n", - "14328 2014 COMPACT 202\n", - "14329 2014 COMPACT 230\n", - "14330 2014 MID-SIZE 205\n", - "14331 2014 MID-SIZE 230\n", - "14332 2014 SUV - SMALL 223\n", - "14333 2014 SUV - SMALL 237\n", - "14334 2014 SUV - SMALL 230\n", - "14335 2014 SUV - SMALL 237\n", - "14336 2014 SUV - SMALL 225\n", - "14337 2014 SUV - STANDARD 258\n", - "\n", - "[14338 rows x 3 columns]" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cols = ['MODEL','VEHICLE CLASS', 'CO2 EMISSIONS']\n", - "df=df[cols]\n", - "newcols = {\n", - " 'MODEL': 'year', \n", - " 'VEHICLE CLASS':'vclass', \n", - " 'CO2 EMISSIONS':'co2'}\n", - "df.rename(columns=newcols, inplace=True)\n", - "df=df.drop(df.index[0])\n", - "df = df.reset_index(drop=True)\n", - "df" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
yearco2
count14338.00000014338.000000
mean2007.621914248.570721
std4.13948859.113725
min2000.00000083.000000
25%2004.000000209.000000
50%2008.000000239.000000
75%2011.000000285.000000
max2014.000000570.000000
\n", - "
" - ], - "text/plain": [ - " year co2\n", - "count 14338.000000 14338.000000\n", - "mean 2007.621914 248.570721\n", - "std 4.139488 59.113725\n", - "min 2000.000000 83.000000\n", - "25% 2004.000000 209.000000\n", - "50% 2008.000000 239.000000\n", - "75% 2011.000000 285.000000\n", - "max 2014.000000 570.000000" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df['co2'] = df['co2'].astype(float)\n", - "df['vclass']=df['vclass'].astype(str)\n", - "df['year'] = df['year'].astype(int)\n", - "df.describe()" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
yearvclassco2
020003175.0
120002230.0
220002264.0
320001198.0
420001189.0
520001191.0
620001267.0
720001269.0
820003218.0
920003193.0
1020003248.0
1120003225.0
1220003232.0
1320003214.0
1420003255.0
1520003251.0
1620002258.0
1720002264.0
1820002267.0
1920002269.0
2020002260.0
2120002269.0
2220002269.0
2320003264.0
2420003267.0
2520004214.0
2620004225.0
2720003258.0
2820003246.0
2920003237.0
............
766320143246.0
766420141189.0
766520146189.0
766620146189.0
766720146162.0
766820146157.0
766920143163.0
767020143161.0
767120143186.0
767220143177.0
767320143177.0
767420143182.0
767520143157.0
767620143157.0
767720143101.0
767820142168.0
767920142168.0
768020142191.0
768120142196.0
768220142216.0
768320142162.0
768420142154.0
768520147246.0
768620147243.0
768720143193.0
768820143202.0
768920143230.0
769020142205.0
769120142230.0
769220147258.0
\n", - "

7693 rows × 3 columns

\n", - "
" - ], - "text/plain": [ - " year vclass co2\n", - "0 2000 3 175.0\n", - "1 2000 2 230.0\n", - "2 2000 2 264.0\n", - "3 2000 1 198.0\n", - "4 2000 1 189.0\n", - "5 2000 1 191.0\n", - "6 2000 1 267.0\n", - "7 2000 1 269.0\n", - "8 2000 3 218.0\n", - "9 2000 3 193.0\n", - "10 2000 3 248.0\n", - "11 2000 3 225.0\n", - "12 2000 3 232.0\n", - "13 2000 3 214.0\n", - "14 2000 3 255.0\n", - "15 2000 3 251.0\n", - "16 2000 2 258.0\n", - "17 2000 2 264.0\n", - "18 2000 2 267.0\n", - "19 2000 2 269.0\n", - "20 2000 2 260.0\n", - "21 2000 2 269.0\n", - "22 2000 2 269.0\n", - "23 2000 3 264.0\n", - "24 2000 3 267.0\n", - "25 2000 4 214.0\n", - "26 2000 4 225.0\n", - "27 2000 3 258.0\n", - "28 2000 3 246.0\n", - "29 2000 3 237.0\n", - "... ... ... ...\n", - "7663 2014 3 246.0\n", - "7664 2014 1 189.0\n", - "7665 2014 6 189.0\n", - "7666 2014 6 189.0\n", - "7667 2014 6 162.0\n", - "7668 2014 6 157.0\n", - "7669 2014 3 163.0\n", - "7670 2014 3 161.0\n", - "7671 2014 3 186.0\n", - "7672 2014 3 177.0\n", - "7673 2014 3 177.0\n", - "7674 2014 3 182.0\n", - "7675 2014 3 157.0\n", - "7676 2014 3 157.0\n", - "7677 2014 3 101.0\n", - "7678 2014 2 168.0\n", - "7679 2014 2 168.0\n", - "7680 2014 2 191.0\n", - "7681 2014 2 196.0\n", - "7682 2014 2 216.0\n", - "7683 2014 2 162.0\n", - "7684 2014 2 154.0\n", - "7685 2014 7 246.0\n", - "7686 2014 7 243.0\n", - "7687 2014 3 193.0\n", - "7688 2014 3 202.0\n", - "7689 2014 3 230.0\n", - "7690 2014 2 205.0\n", - "7691 2014 2 230.0\n", - "7692 2014 7 258.0\n", - "\n", - "[7693 rows x 3 columns]" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df = df.drop( df[ (df.vclass !='SUBCOMPACT' ) & (df.vclass !='MID-SIZE' ) & (df.vclass !='COMPACT' ) & (df.vclass !='TWO-SEATER' ) & (df.vclass !='FULL-SIZE' ) & (df.vclass !='STATION WAGON - SMALL' ) & (df.vclass !='SUV - STANDARD' )].index )\n", - "df.index = range(len(df))\n", - "df['vclass'] = df['vclass'].replace('SUBCOMPACT', '1')\n", - "df['vclass'] = df['vclass'].replace('MID-SIZE', '2')\n", - "df['vclass'] = df['vclass'].replace('COMPACT', '3')\n", - "df['vclass'] = df['vclass'].replace('TWO-SEATER', '4')\n", - "df['vclass'] = df['vclass'].replace('FULL-SIZE', '5')\n", - "df['vclass'] = df['vclass'].replace('STATION WAGON - SMALL', '6')\n", - "df['vclass'] = df['vclass'].replace('SUV - STANDARD', '7')\n", - "df['vclass'] = df['vclass'].astype(int)\n", - "df\n" - ] - }, - { - "cell_type": "code", - "execution_count": 28, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "Intercept 3214.660155\n", - "vclass 4.951835\n", - "year -1.495280\n", - "dtype: float64" - ] - }, - "execution_count": 28, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "model = smf.ols(formula='co2 ~ vclass + year', data=df).fit()\n", - "model.paramslm = smf.ols(formula='co2 ~ vclass + year', data=df).fit()\n", - "model.params #parameters" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "
OLS Regression Results
Dep. Variable: co2 R-squared: 0.029
Model: OLS Adj. R-squared: 0.028
Method: Least Squares F-statistic: 113.0
Date: Sat, 08 Jul 2017 Prob (F-statistic): 4.30e-49
Time: 19:21:09 Log-Likelihood: -41746.
No. Observations: 7693 AIC: 8.350e+04
Df Residuals: 7690 BIC: 8.352e+04
Df Model: 2
Covariance Type: nonrobust
\n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "
coef std err t P>|t| [95.0% Conf. Int.]
Intercept 3214.6602 300.499 10.698 0.000 2625.601 3803.720
vclass 4.9518 0.391 12.654 0.000 4.185 5.719
year -1.4953 0.150 -9.985 0.000 -1.789 -1.202
\n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "\n", - " \n", - "\n", - "
Omnibus: 1590.732 Durbin-Watson: 0.587
Prob(Omnibus): 0.000 Jarque-Bera (JB): 3807.756
Skew: 1.152 Prob(JB): 0.00
Kurtosis: 5.563 Cond. No. 9.62e+05
" - ], - "text/plain": [ - "\n", - "\"\"\"\n", - " OLS Regression Results \n", - "==============================================================================\n", - "Dep. Variable: co2 R-squared: 0.029\n", - "Model: OLS Adj. R-squared: 0.028\n", - "Method: Least Squares F-statistic: 113.0\n", - "Date: Sat, 08 Jul 2017 Prob (F-statistic): 4.30e-49\n", - "Time: 19:21:09 Log-Likelihood: -41746.\n", - "No. Observations: 7693 AIC: 8.350e+04\n", - "Df Residuals: 7690 BIC: 8.352e+04\n", - "Df Model: 2 \n", - "Covariance Type: nonrobust \n", - "==============================================================================\n", - " coef std err t P>|t| [95.0% Conf. Int.]\n", - "------------------------------------------------------------------------------\n", - "Intercept 3214.6602 300.499 10.698 0.000 2625.601 3803.720\n", - "vclass 4.9518 0.391 12.654 0.000 4.185 5.719\n", - "year -1.4953 0.150 -9.985 0.000 -1.789 -1.202\n", - "==============================================================================\n", - "Omnibus: 1590.732 Durbin-Watson: 0.587\n", - "Prob(Omnibus): 0.000 Jarque-Bera (JB): 3807.756\n", - "Skew: 1.152 Prob(JB): 0.00\n", - "Kurtosis: 5.563 Cond. No. 9.62e+05\n", - "==============================================================================\n", - "\n", - "Warnings:\n", - "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n", - "[2] The condition number is large, 9.62e+05. This might indicate that there are\n", - "strong multicollinearity or other numerical problems.\n", - "\"\"\"" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "model.summary()" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
vclassyear
062000
\n", - "
" - ], - "text/plain": [ - " vclass year\n", - "0 6 2000" - ] - }, - "execution_count": 16, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "toPredict = pd.DataFrame({'vclass': [6], 'year':[2000]})\n", - "toPredict.head()" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "array([ 253.81176846])" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "prediction=model.predict(toPredict)\n", - "prediction" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "So now what we have is basically a cleaned dataset for electric vehicles and the approximate difference in the CO2 that is emitted by a normal vehicle and the CO2 emitted by an electric car (which is nothing)\n", - "\n", - "so the basic flow structure is\n", - "1. Get the source and destination from the user - source GPS destination and destination user entered\n", - "2. Get details of the vehicle - make, model and distance until recharge necessary/ current battery level\n", - "3. Get the rest of the details from the database/dataframe (year, vehicle class, range, consumption, recharge time)\n", - "4. Use the vehicle class and year to predict the amount of CO2 a car using fuel would consume\n", - "5. Use the algorithm to check the time and fuel requirements" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Algorithm:\n", - "inputs: \n", - " 1. Given by user: make model currentDistance\n", - " 2. Extracted from database: year vehicle class range consumption recharge time\n", - "outputs: The difference in CO2 emitted in kilograms, recharge time) and consumption of fuel\n", - "\n", - "Procedure:\n", - "1. get inputs from user\n", - "2. catculate distance between source and destination\n", - "3. check if the distance is greater than current distance that can be viewed on the dashboard of electric vehicles\n", - "4. if it is less than, there is no issue and the journey can be completed safely\n", - "4. if it is greater than find total distance it can travel with a leeway of 10miles (16 km) by taking total distance-(currentdistance-16)=total charge required\n", - " therefore, total time required to charge=recharge time/range * (total charge required) \n", - "5. give time taken for recharge and the fuel consumption in KW/hr and le\n", - "6. get values of vehicle class and year from the db and use it to query how much of CO2 would have been consumed by a car that runs on fuel \n", - "7. display the results to the user" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Example:\n", - "\n", - " source: Chelan, Saskatchewan, Canada\n", - "\n", - " destination: Maymont, Saskatchewan, Canada\n", - " \n", - " distance: 353 km\n", - " \n", - " make: TESLA \t\n", - " \n", - " model: MODEL S P100D\n", - " \n", - " curent distance: 150 km" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
yearmakemodelvclassfuelcityElechwyEleccombEleccityGashwyGascombGasco2co2RatesmogRatedistrecharge
562016TESLAMODEL S P100DFULL-SIZEB22.62021.52.52.32.4010n/a50712
\n", - "
" - ], - "text/plain": [ - " year make model vclass fuel cityElec hwyElec combElec \\\n", - "56 2016 TESLA MODEL S P100D FULL-SIZE B 22.6 20 21.5 \n", - "\n", - " cityGas hwyGas combGas co2 co2Rate smogRate dist recharge \n", - "56 2.5 2.3 2.4 0 10 n/a 507 12 " - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "make=\"TESLA\"\n", - "model=\"MODEL S P100D\"\n", - "distance=353\n", - "curdist=150\n", - "res=elec.loc[(elec['make'] == make) & (elec['model'] == model)]\n", - "res" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "56 507\n", - "Name: dist, dtype: int32" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "maxdist=res['dist'].astype('int')\n", - "maxdist" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "56 12\n", - "Name: recharge, dtype: int32" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "recharge=res['recharge'].astype('int')\n", - "recharge" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "56 2016\n", - "Name: year, dtype: int32" - ] - }, - "execution_count": 21, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "year=res['year'].astype('int')\n", - "year" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\Saumya Suvarna\\Anaconda3\\lib\\site-packages\\ipykernel\\__main__.py:1: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " if __name__ == '__main__':\n", - "C:\\Users\\Saumya Suvarna\\Anaconda3\\lib\\site-packages\\ipykernel\\__main__.py:2: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " from ipykernel import kernelapp as app\n", - "C:\\Users\\Saumya Suvarna\\Anaconda3\\lib\\site-packages\\ipykernel\\__main__.py:3: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - " app.launch_new_instance()\n", - "C:\\Users\\Saumya Suvarna\\Anaconda3\\lib\\site-packages\\ipykernel\\__main__.py:4: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - "C:\\Users\\Saumya Suvarna\\Anaconda3\\lib\\site-packages\\ipykernel\\__main__.py:5: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - "C:\\Users\\Saumya Suvarna\\Anaconda3\\lib\\site-packages\\ipykernel\\__main__.py:6: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n", - "C:\\Users\\Saumya Suvarna\\Anaconda3\\lib\\site-packages\\ipykernel\\__main__.py:7: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n" - ] - }, - { - "data": { - "text/plain": [ - "56 5\n", - "Name: vclass, dtype: int32" - ] - }, - "execution_count": 22, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "res['vclass'] = res['vclass'].replace('SUBCOMPACT', '1')\n", - "res['vclass'] = res['vclass'].replace('MID-SIZE', '2')\n", - "res['vclass'] = res['vclass'].replace('COMPACT', '3')\n", - "res['vclass'] = res['vclass'].replace('TWO-SEATER', '4')\n", - "res['vclass'] = res['vclass'].replace('FULL-SIZE', '5')\n", - "res['vclass'] = res['vclass'].replace('STATION WAGON - SMALL', '6')\n", - "res['vclass'] = res['vclass'].replace('SUV - STANDARD', '7')\n", - "vclass = res['vclass'].astype(int)\n", - "vclass" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "56 2.4\n", - "Name: combGas, dtype: float64" - ] - }, - "execution_count": 23, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "combGas=res['combGas'].astype('float')\n", - "combGas" - ] - }, - { - "cell_type": "code", - "execution_count": 24, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "56 21.5\n", - "Name: combElec, dtype: float64" - ] - }, - "execution_count": 24, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "combElec=res['combElec'].astype('float')\n", - "combElec" - ] - }, - { - "cell_type": "code", - "execution_count": 25, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "56 5.183432\n", - "dtype: float64" - ] - }, - "execution_count": 25, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "if (curdist>distance):\n", - " rechargedist=0\n", - " rechargetime=0;\n", - " flag=0\n", - "else:\n", - " rechargedist=distance-(curdist-16)\n", - " rechargetime=recharge/maxdist*(rechargedist)\n", - " flag=1\n", - " \n", - "rechargetime" - ] - }, - { - "cell_type": "code", - "execution_count": 26, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
vclassyear
5652016
\n", - "
" - ], - "text/plain": [ - " vclass year\n", - "56 5 2016" - ] - }, - "execution_count": 26, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "toPredict = pd.DataFrame({'vclass': vclass, 'year':year})\n", - "toPredict.head()" - ] - }, - { - "cell_type": "code", - "execution_count": 29, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "array([ 224.93545828])" - ] - }, - "execution_count": 29, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "prediction=model.predict(toPredict)\n", - "prediction #shows co2 emitted in grams per km" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "co2=prediction*distance/1000 #in kg\n", - "co2" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "fuelconsgas=combGas/100*distance\n", - "fuelconsgas" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "fuelconselec=combElec/100*distance\n", - "fuelconselec" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "print(\"The time you need to reacharge your car to make your journey is %f \"%rechargetime)\n", - "print(\"The fuel reqired for the journey is %f KWH and in Le is %f\"%(fuelconselec,fuelconsgas))\n", - "print(\"Woo hoo you have saved %f kg of CO2 from destroying our earth.\"%co2)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "import matplotlib.pyplot as plt\n", - "import numpy as np\n", - "dist=0\n", - "curdist=150\n", - "x=list()\n", - "y=list()\n", - "maxdist=507\n", - "recharge=12\n", - "while dist <1000:\n", - " \n", - " x.append(dist)\n", - " if (curdist>dist):\n", - " rechargetime=0\n", - " else:\n", - " #if(dist\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
yearmakemodelvclassfuelcityElechwyEleccombEleccityGashwyGascombGasco2co2RatesmogRatedistrechargeco2saved
\n", - "" - ], - "text/plain": [ - "Empty DataFrame\n", - "Columns: [year, make, model, vclass, fuel, cityElec, hwyElec, combElec, cityGas, hwyGas, combGas, co2, co2Rate, smogRate, dist, recharge, co2saved]\n", - "Index: []" - ] - }, - "execution_count": 50, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cols=['year','make','model','vclass','fuel','cityElec','hwyElec','combElec','cityGas','hwyGas','combGas','co2','co2Rate','smogRate','dist','recharge','co2saved']\n", - "db = pd.DataFrame(columns=cols)\n", - "db" - ] - }, - { - "cell_type": "code", - "execution_count": 51, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
cityEleccityGasco2co2Rateco2savedcombEleccombGasdistfuelhwyElechwyGasmakemodelrechargesmogRatevclassyear
016.91.90n/a211.10923718.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02012.0
019.32.20n/a216.06107221.12.4117B232.6NISSANLEAF7n/a2.02012.0
0192.10n/a219.517627202.2122B21.12.4FORDFOCUS ELECTRIC4n/a3.02013.0
016.91.90n/a209.61395718.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02013.0
019.32.20n/a214.56579221.12.4117B232.6NISSANLEAF7n/a2.02013.0
017.21.90n/a224.46946219.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE CABRIOLET8n/a4.02013.0
017.21.90n/a224.46946219.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE COUPE8n/a4.02013.0
022.42.50n/a229.42129722.22.5224B21.92.5TESLAMODEL S (40 kWh battery)6n/a5.02013.0
022.22.50n/a229.42129721.92.5335B21.72.4TESLAMODEL S (60 kWh battery)10n/a5.02013.0
023.82.70n/a229.42129723.62.6426B23.22.6TESLAMODEL S (85 kWh battery)12n/a5.02013.0
023.92.70n/a229.42129723.62.6426B23.22.6TESLAMODEL S PERFORMANCE12n/a5.02013.0
0161.80n/a208.11867817.82131B19.62.2CHEVROLETSPARK EV7n/a1.02014.0
0192.10n/a218.022348202.2122B21.12.4FORDFOCUS ELECTRIC4n/a3.02014.0
016.91.90n/a208.11867818.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02014.0
016.51.90n/a213.07051318.42.1135B20.82.3NISSANLEAF5n/a2.02014.0
017.21.90n/a222.97418319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE CABRIOLET8n/a4.02014.0
017.21.90n/a222.97418319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE COUPE8n/a4.02014.0
022.22.50n/a227.92601821.92.5335B21.72.4TESLAMODEL S (60 kWh battery)10n/a5.02014.0
023.82.70n/a227.92601823.62.6426B23.22.6TESLAMODEL S (85 kWh battery)12n/a5.02014.0
023.92.70n/a227.92601823.62.6426B23.22.6TESLAMODEL S PERFORMANCE12n/a5.02014.0
015.21.70n/a206.62339816.81.9130B18.82.1BMWi34n/a1.02015.0
0161.80n/a206.62339817.82131B19.62.2CHEVROLETSPARK EV7n/a1.02015.0
0192.10n/a216.527068202.2122B21.12.4FORDFOCUS ELECTRIC4n/a3.02015.0
017.520n/a231.38257319.92.2149B22.72.6KIASOUL EV4n/a6.02015.0
016.91.90n/a206.62339818.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02015.0
016.51.90n/a211.57523318.42.1135B20.82.3NISSANLEAF5n/a2.02015.0
017.21.90n/a221.47890319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE CABRIOLET8n/a4.02015.0
017.21.90n/a221.47890319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE COUPE8n/a4.02015.0
022.22.50n/a226.43073821.92.5335B21.72.4TESLAMODEL S (60 kWh battery)10n/a5.02015.0
023.82.70n/a226.43073823.62.6377B23.22.6TESLAMODEL S (70 kWh battery)12n/a5.02015.0
......................................................
023.42.6010224.93545822.52.5407B21.52.4TESLAMODEL S P85D/P90D12n/a5.02016.0
022.92.6010224.93545822.12.5435B212.4TESLAMODEL S P90D (Refresh)12n/a5.02016.0
022.62.5010224.93545821.52.4507B202.3TESLAMODEL S P100D12n/a5.02016.0
0232.6010234.83912822.62.5322B22.22.5TESLAMODEL X 60D10n/a7.02016.0
0232.6010234.83912822.52.5383B21.92.5TESLAMODEL X 75D12n/a7.02016.0
023.22.6010234.83912822.72.6414B22.22.5TESLAMODEL X 90D12n/a7.02016.0
023.62.7010234.83912823.52.6402B23.32.6TESLAMODEL X P90D12n/a7.02016.0
025.72.9010234.83912824.42.7465B22.92.6TESLAMODEL X P100D12n/a7.02016.0
015.21.7010203.63283916.81.9130B18.82.1BMWi3 (60 Ah)4101.02017.0
016.21.8010203.63283917.82183B19.72.2BMWi3 (94 Ah)5101.02017.0
016.41.8010228.39201417.62383B192.1CHEVROLETBOLT EV9.3106.02017.0
017.72010213.53650919.62.2185B21.82.5FORDFOCUS ELECTRIC5.5103.02017.0
017.42010228.39201419.92.2150B232.6KIASOUL EV4106.02017.0
016.91.9010203.63283918.72.1100B20.52.3MITSUBISHIi-MiEV7101.02017.0
0171.9010208.58467418.62.1172B20.72.3NISSANLEAF6102.02017.0
021.52.4010223.44017921.12.4338B20.72.3TESLAMODEL S (60 kWh battery)10105.02017.0
021.52.4010223.44017921.32.4401B212.4TESLAMODEL S (75 kWh battery)12105.02017.0
020.62.3010223.44017920.22.3351B19.62.2TESLAMODEL S 60D10105.02017.0
020.62.3010223.44017920.32.3417B19.92.2TESLAMODEL S 75D12105.02017.0
020.62.3010223.44017920.22.3473B19.72.2TESLAMODEL S 90D12105.02017.0
020.72.3010223.44017920.62.3539B20.52.3TESLAMODEL S 100D12105.02017.0
022.82.6010223.440179222.5435B20.92.3TESLAMODEL S P90D12105.02017.0
022.62.5010223.44017921.52.4507B202.3TESLAMODEL S P100D12105.02017.0
0232.6010233.34384922.62.5322B22.22.5TESLAMODEL X 60D10107.02017.0
0232.6010233.34384922.52.5383B21.92.5TESLAMODEL X 75D12107.02017.0
023.22.6010233.34384922.72.6414B22.22.5TESLAMODEL X 90D12107.02017.0
024.32.7010233.343849242.7475B23.72.7TESLAMODEL X 100D12107.02017.0
023.62.7010233.34384923.52.6402B23.32.6TESLAMODEL X P90D12107.02017.0
025.72.9010233.34384924.42.7465B22.92.6TESLAMODEL X P100D12107.02017.0
016.81.9010213.53650917.42201B18.62.1VOLKSWAGENe-GOLF5.3103.02017.0
\n", - "

83 rows × 17 columns

\n", - "
" - ], - "text/plain": [ - " cityElec cityGas co2 co2Rate co2saved combElec combGas dist fuel \\\n", - "0 16.9 1.9 0 n/a 211.109237 18.7 2.1 100 B \n", - "0 19.3 2.2 0 n/a 216.061072 21.1 2.4 117 B \n", - "0 19 2.1 0 n/a 219.517627 20 2.2 122 B \n", - "0 16.9 1.9 0 n/a 209.613957 18.7 2.1 100 B \n", - "0 19.3 2.2 0 n/a 214.565792 21.1 2.4 117 B \n", - "0 17.2 1.9 0 n/a 224.469462 19.6 2.2 109 B \n", - "0 17.2 1.9 0 n/a 224.469462 19.6 2.2 109 B \n", - "0 22.4 2.5 0 n/a 229.421297 22.2 2.5 224 B \n", - "0 22.2 2.5 0 n/a 229.421297 21.9 2.5 335 B \n", - "0 23.8 2.7 0 n/a 229.421297 23.6 2.6 426 B \n", - "0 23.9 2.7 0 n/a 229.421297 23.6 2.6 426 B \n", - "0 16 1.8 0 n/a 208.118678 17.8 2 131 B \n", - "0 19 2.1 0 n/a 218.022348 20 2.2 122 B \n", - "0 16.9 1.9 0 n/a 208.118678 18.7 2.1 100 B \n", - "0 16.5 1.9 0 n/a 213.070513 18.4 2.1 135 B \n", - "0 17.2 1.9 0 n/a 222.974183 19.6 2.2 109 B \n", - "0 17.2 1.9 0 n/a 222.974183 19.6 2.2 109 B \n", - "0 22.2 2.5 0 n/a 227.926018 21.9 2.5 335 B \n", - "0 23.8 2.7 0 n/a 227.926018 23.6 2.6 426 B \n", - "0 23.9 2.7 0 n/a 227.926018 23.6 2.6 426 B \n", - "0 15.2 1.7 0 n/a 206.623398 16.8 1.9 130 B \n", - "0 16 1.8 0 n/a 206.623398 17.8 2 131 B \n", - "0 19 2.1 0 n/a 216.527068 20 2.2 122 B \n", - "0 17.5 2 0 n/a 231.382573 19.9 2.2 149 B \n", - "0 16.9 1.9 0 n/a 206.623398 18.7 2.1 100 B \n", - "0 16.5 1.9 0 n/a 211.575233 18.4 2.1 135 B \n", - "0 17.2 1.9 0 n/a 221.478903 19.6 2.2 109 B \n", - "0 17.2 1.9 0 n/a 221.478903 19.6 2.2 109 B \n", - "0 22.2 2.5 0 n/a 226.430738 21.9 2.5 335 B \n", - "0 23.8 2.7 0 n/a 226.430738 23.6 2.6 377 B \n", - ".. ... ... .. ... ... ... ... ... ... \n", - "0 23.4 2.6 0 10 224.935458 22.5 2.5 407 B \n", - "0 22.9 2.6 0 10 224.935458 22.1 2.5 435 B \n", - "0 22.6 2.5 0 10 224.935458 21.5 2.4 507 B \n", - "0 23 2.6 0 10 234.839128 22.6 2.5 322 B \n", - "0 23 2.6 0 10 234.839128 22.5 2.5 383 B \n", - "0 23.2 2.6 0 10 234.839128 22.7 2.6 414 B \n", - "0 23.6 2.7 0 10 234.839128 23.5 2.6 402 B \n", - "0 25.7 2.9 0 10 234.839128 24.4 2.7 465 B \n", - "0 15.2 1.7 0 10 203.632839 16.8 1.9 130 B \n", - "0 16.2 1.8 0 10 203.632839 17.8 2 183 B \n", - "0 16.4 1.8 0 10 228.392014 17.6 2 383 B \n", - "0 17.7 2 0 10 213.536509 19.6 2.2 185 B \n", - "0 17.4 2 0 10 228.392014 19.9 2.2 150 B \n", - "0 16.9 1.9 0 10 203.632839 18.7 2.1 100 B \n", - "0 17 1.9 0 10 208.584674 18.6 2.1 172 B \n", - "0 21.5 2.4 0 10 223.440179 21.1 2.4 338 B \n", - "0 21.5 2.4 0 10 223.440179 21.3 2.4 401 B \n", - "0 20.6 2.3 0 10 223.440179 20.2 2.3 351 B \n", - "0 20.6 2.3 0 10 223.440179 20.3 2.3 417 B \n", - "0 20.6 2.3 0 10 223.440179 20.2 2.3 473 B \n", - "0 20.7 2.3 0 10 223.440179 20.6 2.3 539 B \n", - "0 22.8 2.6 0 10 223.440179 22 2.5 435 B \n", - "0 22.6 2.5 0 10 223.440179 21.5 2.4 507 B \n", - "0 23 2.6 0 10 233.343849 22.6 2.5 322 B \n", - "0 23 2.6 0 10 233.343849 22.5 2.5 383 B \n", - "0 23.2 2.6 0 10 233.343849 22.7 2.6 414 B \n", - "0 24.3 2.7 0 10 233.343849 24 2.7 475 B \n", - "0 23.6 2.7 0 10 233.343849 23.5 2.6 402 B \n", - "0 25.7 2.9 0 10 233.343849 24.4 2.7 465 B \n", - "0 16.8 1.9 0 10 213.536509 17.4 2 201 B \n", - "\n", - " hwyElec hwyGas make model recharge \\\n", - "0 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "0 23 2.6 NISSAN LEAF 7 \n", - "0 21.1 2.4 FORD FOCUS ELECTRIC 4 \n", - "0 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "0 23 2.6 NISSAN LEAF 7 \n", - "0 22.5 2.5 SMART FORTWO ELECTRIC DRIVE CABRIOLET 8 \n", - "0 22.5 2.5 SMART FORTWO ELECTRIC DRIVE COUPE 8 \n", - "0 21.9 2.5 TESLA MODEL S (40 kWh battery) 6 \n", - "0 21.7 2.4 TESLA MODEL S (60 kWh battery) 10 \n", - "0 23.2 2.6 TESLA MODEL S (85 kWh battery) 12 \n", - "0 23.2 2.6 TESLA MODEL S PERFORMANCE 12 \n", - "0 19.6 2.2 CHEVROLET SPARK EV 7 \n", - "0 21.1 2.4 FORD FOCUS ELECTRIC 4 \n", - "0 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "0 20.8 2.3 NISSAN LEAF 5 \n", - "0 22.5 2.5 SMART FORTWO ELECTRIC DRIVE CABRIOLET 8 \n", - "0 22.5 2.5 SMART FORTWO ELECTRIC DRIVE COUPE 8 \n", - "0 21.7 2.4 TESLA MODEL S (60 kWh battery) 10 \n", - "0 23.2 2.6 TESLA MODEL S (85 kWh battery) 12 \n", - "0 23.2 2.6 TESLA MODEL S PERFORMANCE 12 \n", - "0 18.8 2.1 BMW i3 4 \n", - "0 19.6 2.2 CHEVROLET SPARK EV 7 \n", - "0 21.1 2.4 FORD FOCUS ELECTRIC 4 \n", - "0 22.7 2.6 KIA SOUL EV 4 \n", - "0 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "0 20.8 2.3 NISSAN LEAF 5 \n", - "0 22.5 2.5 SMART FORTWO ELECTRIC DRIVE CABRIOLET 8 \n", - "0 22.5 2.5 SMART FORTWO ELECTRIC DRIVE COUPE 8 \n", - "0 21.7 2.4 TESLA MODEL S (60 kWh battery) 10 \n", - "0 23.2 2.6 TESLA MODEL S (70 kWh battery) 12 \n", - ".. ... ... ... ... ... \n", - "0 21.5 2.4 TESLA MODEL S P85D/P90D 12 \n", - "0 21 2.4 TESLA MODEL S P90D (Refresh) 12 \n", - "0 20 2.3 TESLA MODEL S P100D 12 \n", - "0 22.2 2.5 TESLA MODEL X 60D 10 \n", - "0 21.9 2.5 TESLA MODEL X 75D 12 \n", - "0 22.2 2.5 TESLA MODEL X 90D 12 \n", - "0 23.3 2.6 TESLA MODEL X P90D 12 \n", - "0 22.9 2.6 TESLA MODEL X P100D 12 \n", - "0 18.8 2.1 BMW i3 (60 Ah) 4 \n", - "0 19.7 2.2 BMW i3 (94 Ah) 5 \n", - "0 19 2.1 CHEVROLET BOLT EV 9.3 \n", - "0 21.8 2.5 FORD FOCUS ELECTRIC 5.5 \n", - "0 23 2.6 KIA SOUL EV 4 \n", - "0 20.5 2.3 MITSUBISHI i-MiEV 7 \n", - "0 20.7 2.3 NISSAN LEAF 6 \n", - "0 20.7 2.3 TESLA MODEL S (60 kWh battery) 10 \n", - "0 21 2.4 TESLA MODEL S (75 kWh battery) 12 \n", - "0 19.6 2.2 TESLA MODEL S 60D 10 \n", - "0 19.9 2.2 TESLA MODEL S 75D 12 \n", - "0 19.7 2.2 TESLA MODEL S 90D 12 \n", - "0 20.5 2.3 TESLA MODEL S 100D 12 \n", - "0 20.9 2.3 TESLA MODEL S P90D 12 \n", - "0 20 2.3 TESLA MODEL S P100D 12 \n", - "0 22.2 2.5 TESLA MODEL X 60D 10 \n", - "0 21.9 2.5 TESLA MODEL X 75D 12 \n", - "0 22.2 2.5 TESLA MODEL X 90D 12 \n", - "0 23.7 2.7 TESLA MODEL X 100D 12 \n", - "0 23.3 2.6 TESLA MODEL X P90D 12 \n", - "0 22.9 2.6 TESLA MODEL X P100D 12 \n", - "0 18.6 2.1 VOLKSWAGEN e-GOLF 5.3 \n", - "\n", - " smogRate vclass year \n", - "0 n/a 1.0 2012.0 \n", - "0 n/a 2.0 2012.0 \n", - "0 n/a 3.0 2013.0 \n", - "0 n/a 1.0 2013.0 \n", - "0 n/a 2.0 2013.0 \n", - "0 n/a 4.0 2013.0 \n", - "0 n/a 4.0 2013.0 \n", - "0 n/a 5.0 2013.0 \n", - "0 n/a 5.0 2013.0 \n", - "0 n/a 5.0 2013.0 \n", - "0 n/a 5.0 2013.0 \n", - "0 n/a 1.0 2014.0 \n", - "0 n/a 3.0 2014.0 \n", - "0 n/a 1.0 2014.0 \n", - "0 n/a 2.0 2014.0 \n", - "0 n/a 4.0 2014.0 \n", - "0 n/a 4.0 2014.0 \n", - "0 n/a 5.0 2014.0 \n", - "0 n/a 5.0 2014.0 \n", - "0 n/a 5.0 2014.0 \n", - "0 n/a 1.0 2015.0 \n", - "0 n/a 1.0 2015.0 \n", - "0 n/a 3.0 2015.0 \n", - "0 n/a 6.0 2015.0 \n", - "0 n/a 1.0 2015.0 \n", - "0 n/a 2.0 2015.0 \n", - "0 n/a 4.0 2015.0 \n", - "0 n/a 4.0 2015.0 \n", - "0 n/a 5.0 2015.0 \n", - "0 n/a 5.0 2015.0 \n", - ".. ... ... ... \n", - "0 n/a 5.0 2016.0 \n", - "0 n/a 5.0 2016.0 \n", - "0 n/a 5.0 2016.0 \n", - "0 n/a 7.0 2016.0 \n", - "0 n/a 7.0 2016.0 \n", - "0 n/a 7.0 2016.0 \n", - "0 n/a 7.0 2016.0 \n", - "0 n/a 7.0 2016.0 \n", - "0 10 1.0 2017.0 \n", - "0 10 1.0 2017.0 \n", - "0 10 6.0 2017.0 \n", - "0 10 3.0 2017.0 \n", - "0 10 6.0 2017.0 \n", - "0 10 1.0 2017.0 \n", - "0 10 2.0 2017.0 \n", - "0 10 5.0 2017.0 \n", - "0 10 5.0 2017.0 \n", - "0 10 5.0 2017.0 \n", - "0 10 5.0 2017.0 \n", - "0 10 5.0 2017.0 \n", - "0 10 5.0 2017.0 \n", - "0 10 5.0 2017.0 \n", - "0 10 5.0 2017.0 \n", - "0 10 7.0 2017.0 \n", - "0 10 7.0 2017.0 \n", - "0 10 7.0 2017.0 \n", - "0 10 7.0 2017.0 \n", - "0 10 7.0 2017.0 \n", - "0 10 7.0 2017.0 \n", - "0 10 3.0 2017.0 \n", - "\n", - "[83 rows x 17 columns]" - ] - }, - "execution_count": 51, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "for index, row in elec.iterrows():\n", - " vclass=row[\"vclass\"]\n", - " if( vclass == 'SUBCOMPACT'):\n", - " vclass=int(1)\n", - " elif(vclass =='MID-SIZE'):\n", - " vclass=int(2)\n", - " elif(vclass =='COMPACT'):\n", - " vclass=int(3)\n", - " elif(vclass =='TWO-SEATER'):\n", - " vclass=int(4)\n", - " elif(vclass =='FULL-SIZE'):\n", - " vclass=int(5)\n", - " elif(vclass =='STATION WAGON - SMALL'):\n", - " vclass=int(6)\n", - " elif(vclass =='SUV - STANDARD'):\n", - " vclass=int(7)\n", - " year=int(row[\"year\"])\n", - " toPredict = pd.DataFrame({'vclass':[vclass], 'year':[year]})\n", - " #print(toPredict.head())\n", - " prediction=model.predict(toPredict)\n", - " #print(prediction)\n", - " dfrow=pd.DataFrame({'year':[year],'make':row[\"make\"],'model':row[\"model\"],'vclass':[vclass],'fuel':row[\"fuel\"],'cityElec':row[\"cityElec\"],'hwyElec':row[\"hwyElec\"],'combElec':row[\"combElec\"],'cityGas':row[\"cityGas\"],'hwyGas':row[\"hwyGas\"],'combGas':row[\"combGas\"],'co2':row[\"co2\"],'co2Rate':row[\"co2Rate\"],'smogRate':row[\"smogRate\"],'dist':row[\"dist\"],'recharge':row[\"recharge\"],'co2saved':prediction})\n", - " db = db.append(dfrow)\n", - "db" - ] - }, - { - "cell_type": "code", - "execution_count": 52, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
cityEleccityGasco2co2Rateco2savedcombEleccombGasdistfuelhwyElechwyGasmakemodelrechargesmogRatevclassyear
016.91.90n/a211.10923718.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02012.0
119.32.20n/a216.06107221.12.4117B232.6NISSANLEAF7n/a2.02012.0
2192.10n/a219.517627202.2122B21.12.4FORDFOCUS ELECTRIC4n/a3.02013.0
316.91.90n/a209.61395718.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02013.0
419.32.20n/a214.56579221.12.4117B232.6NISSANLEAF7n/a2.02013.0
517.21.90n/a224.46946219.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE CABRIOLET8n/a4.02013.0
617.21.90n/a224.46946219.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE COUPE8n/a4.02013.0
722.42.50n/a229.42129722.22.5224B21.92.5TESLAMODEL S (40 kWh battery)6n/a5.02013.0
822.22.50n/a229.42129721.92.5335B21.72.4TESLAMODEL S (60 kWh battery)10n/a5.02013.0
923.82.70n/a229.42129723.62.6426B23.22.6TESLAMODEL S (85 kWh battery)12n/a5.02013.0
1023.92.70n/a229.42129723.62.6426B23.22.6TESLAMODEL S PERFORMANCE12n/a5.02013.0
11161.80n/a208.11867817.82131B19.62.2CHEVROLETSPARK EV7n/a1.02014.0
12192.10n/a218.022348202.2122B21.12.4FORDFOCUS ELECTRIC4n/a3.02014.0
1316.91.90n/a208.11867818.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02014.0
1416.51.90n/a213.07051318.42.1135B20.82.3NISSANLEAF5n/a2.02014.0
1517.21.90n/a222.97418319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE CABRIOLET8n/a4.02014.0
1617.21.90n/a222.97418319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE COUPE8n/a4.02014.0
1722.22.50n/a227.92601821.92.5335B21.72.4TESLAMODEL S (60 kWh battery)10n/a5.02014.0
1823.82.70n/a227.92601823.62.6426B23.22.6TESLAMODEL S (85 kWh battery)12n/a5.02014.0
1923.92.70n/a227.92601823.62.6426B23.22.6TESLAMODEL S PERFORMANCE12n/a5.02014.0
2015.21.70n/a206.62339816.81.9130B18.82.1BMWi34n/a1.02015.0
21161.80n/a206.62339817.82131B19.62.2CHEVROLETSPARK EV7n/a1.02015.0
22192.10n/a216.527068202.2122B21.12.4FORDFOCUS ELECTRIC4n/a3.02015.0
2317.520n/a231.38257319.92.2149B22.72.6KIASOUL EV4n/a6.02015.0
2416.91.90n/a206.62339818.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02015.0
2516.51.90n/a211.57523318.42.1135B20.82.3NISSANLEAF5n/a2.02015.0
2617.21.90n/a221.47890319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE CABRIOLET8n/a4.02015.0
2717.21.90n/a221.47890319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE COUPE8n/a4.02015.0
2822.22.50n/a226.43073821.92.5335B21.72.4TESLAMODEL S (60 kWh battery)10n/a5.02015.0
2923.82.70n/a226.43073823.62.6377B23.22.6TESLAMODEL S (70 kWh battery)12n/a5.02015.0
......................................................
5323.42.6010224.93545822.52.5407B21.52.4TESLAMODEL S P85D/P90D12n/a5.02016.0
5422.92.6010224.93545822.12.5435B212.4TESLAMODEL S P90D (Refresh)12n/a5.02016.0
5522.62.5010224.93545821.52.4507B202.3TESLAMODEL S P100D12n/a5.02016.0
56232.6010234.83912822.62.5322B22.22.5TESLAMODEL X 60D10n/a7.02016.0
57232.6010234.83912822.52.5383B21.92.5TESLAMODEL X 75D12n/a7.02016.0
5823.22.6010234.83912822.72.6414B22.22.5TESLAMODEL X 90D12n/a7.02016.0
5923.62.7010234.83912823.52.6402B23.32.6TESLAMODEL X P90D12n/a7.02016.0
6025.72.9010234.83912824.42.7465B22.92.6TESLAMODEL X P100D12n/a7.02016.0
6115.21.7010203.63283916.81.9130B18.82.1BMWi3 (60 Ah)4101.02017.0
6216.21.8010203.63283917.82183B19.72.2BMWi3 (94 Ah)5101.02017.0
6316.41.8010228.39201417.62383B192.1CHEVROLETBOLT EV9.3106.02017.0
6417.72010213.53650919.62.2185B21.82.5FORDFOCUS ELECTRIC5.5103.02017.0
6517.42010228.39201419.92.2150B232.6KIASOUL EV4106.02017.0
6616.91.9010203.63283918.72.1100B20.52.3MITSUBISHIi-MiEV7101.02017.0
67171.9010208.58467418.62.1172B20.72.3NISSANLEAF6102.02017.0
6821.52.4010223.44017921.12.4338B20.72.3TESLAMODEL S (60 kWh battery)10105.02017.0
6921.52.4010223.44017921.32.4401B212.4TESLAMODEL S (75 kWh battery)12105.02017.0
7020.62.3010223.44017920.22.3351B19.62.2TESLAMODEL S 60D10105.02017.0
7120.62.3010223.44017920.32.3417B19.92.2TESLAMODEL S 75D12105.02017.0
7220.62.3010223.44017920.22.3473B19.72.2TESLAMODEL S 90D12105.02017.0
7320.72.3010223.44017920.62.3539B20.52.3TESLAMODEL S 100D12105.02017.0
7422.82.6010223.440179222.5435B20.92.3TESLAMODEL S P90D12105.02017.0
7522.62.5010223.44017921.52.4507B202.3TESLAMODEL S P100D12105.02017.0
76232.6010233.34384922.62.5322B22.22.5TESLAMODEL X 60D10107.02017.0
77232.6010233.34384922.52.5383B21.92.5TESLAMODEL X 75D12107.02017.0
7823.22.6010233.34384922.72.6414B22.22.5TESLAMODEL X 90D12107.02017.0
7924.32.7010233.343849242.7475B23.72.7TESLAMODEL X 100D12107.02017.0
8023.62.7010233.34384923.52.6402B23.32.6TESLAMODEL X P90D12107.02017.0
8125.72.9010233.34384924.42.7465B22.92.6TESLAMODEL X P100D12107.02017.0
8216.81.9010213.53650917.42201B18.62.1VOLKSWAGENe-GOLF5.3103.02017.0
\n", - "

83 rows × 17 columns

\n", - "
" - ], - "text/plain": [ - " cityElec cityGas co2 co2Rate co2saved combElec combGas dist fuel \\\n", - "0 16.9 1.9 0 n/a 211.109237 18.7 2.1 100 B \n", - "1 19.3 2.2 0 n/a 216.061072 21.1 2.4 117 B \n", - "2 19 2.1 0 n/a 219.517627 20 2.2 122 B \n", - "3 16.9 1.9 0 n/a 209.613957 18.7 2.1 100 B \n", - "4 19.3 2.2 0 n/a 214.565792 21.1 2.4 117 B \n", - "5 17.2 1.9 0 n/a 224.469462 19.6 2.2 109 B \n", - "6 17.2 1.9 0 n/a 224.469462 19.6 2.2 109 B \n", - "7 22.4 2.5 0 n/a 229.421297 22.2 2.5 224 B \n", - "8 22.2 2.5 0 n/a 229.421297 21.9 2.5 335 B \n", - "9 23.8 2.7 0 n/a 229.421297 23.6 2.6 426 B \n", - "10 23.9 2.7 0 n/a 229.421297 23.6 2.6 426 B \n", - "11 16 1.8 0 n/a 208.118678 17.8 2 131 B \n", - "12 19 2.1 0 n/a 218.022348 20 2.2 122 B \n", - "13 16.9 1.9 0 n/a 208.118678 18.7 2.1 100 B \n", - "14 16.5 1.9 0 n/a 213.070513 18.4 2.1 135 B \n", - "15 17.2 1.9 0 n/a 222.974183 19.6 2.2 109 B \n", - "16 17.2 1.9 0 n/a 222.974183 19.6 2.2 109 B \n", - "17 22.2 2.5 0 n/a 227.926018 21.9 2.5 335 B \n", - "18 23.8 2.7 0 n/a 227.926018 23.6 2.6 426 B \n", - "19 23.9 2.7 0 n/a 227.926018 23.6 2.6 426 B \n", - "20 15.2 1.7 0 n/a 206.623398 16.8 1.9 130 B \n", - "21 16 1.8 0 n/a 206.623398 17.8 2 131 B \n", - "22 19 2.1 0 n/a 216.527068 20 2.2 122 B \n", - "23 17.5 2 0 n/a 231.382573 19.9 2.2 149 B \n", - "24 16.9 1.9 0 n/a 206.623398 18.7 2.1 100 B \n", - "25 16.5 1.9 0 n/a 211.575233 18.4 2.1 135 B \n", - "26 17.2 1.9 0 n/a 221.478903 19.6 2.2 109 B \n", - "27 17.2 1.9 0 n/a 221.478903 19.6 2.2 109 B \n", - "28 22.2 2.5 0 n/a 226.430738 21.9 2.5 335 B \n", - "29 23.8 2.7 0 n/a 226.430738 23.6 2.6 377 B \n", - ".. ... ... .. ... ... ... ... ... ... \n", - "53 23.4 2.6 0 10 224.935458 22.5 2.5 407 B \n", - "54 22.9 2.6 0 10 224.935458 22.1 2.5 435 B \n", - "55 22.6 2.5 0 10 224.935458 21.5 2.4 507 B \n", - "56 23 2.6 0 10 234.839128 22.6 2.5 322 B \n", - "57 23 2.6 0 10 234.839128 22.5 2.5 383 B \n", - "58 23.2 2.6 0 10 234.839128 22.7 2.6 414 B \n", - "59 23.6 2.7 0 10 234.839128 23.5 2.6 402 B \n", - "60 25.7 2.9 0 10 234.839128 24.4 2.7 465 B \n", - "61 15.2 1.7 0 10 203.632839 16.8 1.9 130 B \n", - "62 16.2 1.8 0 10 203.632839 17.8 2 183 B \n", - "63 16.4 1.8 0 10 228.392014 17.6 2 383 B \n", - "64 17.7 2 0 10 213.536509 19.6 2.2 185 B \n", - "65 17.4 2 0 10 228.392014 19.9 2.2 150 B \n", - "66 16.9 1.9 0 10 203.632839 18.7 2.1 100 B \n", - "67 17 1.9 0 10 208.584674 18.6 2.1 172 B \n", - "68 21.5 2.4 0 10 223.440179 21.1 2.4 338 B \n", - "69 21.5 2.4 0 10 223.440179 21.3 2.4 401 B \n", - "70 20.6 2.3 0 10 223.440179 20.2 2.3 351 B \n", - "71 20.6 2.3 0 10 223.440179 20.3 2.3 417 B \n", - "72 20.6 2.3 0 10 223.440179 20.2 2.3 473 B \n", - "73 20.7 2.3 0 10 223.440179 20.6 2.3 539 B \n", - "74 22.8 2.6 0 10 223.440179 22 2.5 435 B \n", - "75 22.6 2.5 0 10 223.440179 21.5 2.4 507 B \n", - "76 23 2.6 0 10 233.343849 22.6 2.5 322 B \n", - "77 23 2.6 0 10 233.343849 22.5 2.5 383 B \n", - "78 23.2 2.6 0 10 233.343849 22.7 2.6 414 B \n", - "79 24.3 2.7 0 10 233.343849 24 2.7 475 B \n", - "80 23.6 2.7 0 10 233.343849 23.5 2.6 402 B \n", - "81 25.7 2.9 0 10 233.343849 24.4 2.7 465 B \n", - "82 16.8 1.9 0 10 213.536509 17.4 2 201 B \n", - "\n", - " hwyElec hwyGas make model recharge \\\n", - "0 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "1 23 2.6 NISSAN LEAF 7 \n", - "2 21.1 2.4 FORD FOCUS ELECTRIC 4 \n", - "3 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "4 23 2.6 NISSAN LEAF 7 \n", - "5 22.5 2.5 SMART FORTWO ELECTRIC DRIVE CABRIOLET 8 \n", - "6 22.5 2.5 SMART FORTWO ELECTRIC DRIVE COUPE 8 \n", - "7 21.9 2.5 TESLA MODEL S (40 kWh battery) 6 \n", - "8 21.7 2.4 TESLA MODEL S (60 kWh battery) 10 \n", - "9 23.2 2.6 TESLA MODEL S (85 kWh battery) 12 \n", - "10 23.2 2.6 TESLA MODEL S PERFORMANCE 12 \n", - "11 19.6 2.2 CHEVROLET SPARK EV 7 \n", - "12 21.1 2.4 FORD FOCUS ELECTRIC 4 \n", - "13 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "14 20.8 2.3 NISSAN LEAF 5 \n", - "15 22.5 2.5 SMART FORTWO ELECTRIC DRIVE CABRIOLET 8 \n", - "16 22.5 2.5 SMART FORTWO ELECTRIC DRIVE COUPE 8 \n", - "17 21.7 2.4 TESLA MODEL S (60 kWh battery) 10 \n", - "18 23.2 2.6 TESLA MODEL S (85 kWh battery) 12 \n", - "19 23.2 2.6 TESLA MODEL S PERFORMANCE 12 \n", - "20 18.8 2.1 BMW i3 4 \n", - "21 19.6 2.2 CHEVROLET SPARK EV 7 \n", - "22 21.1 2.4 FORD FOCUS ELECTRIC 4 \n", - "23 22.7 2.6 KIA SOUL EV 4 \n", - "24 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "25 20.8 2.3 NISSAN LEAF 5 \n", - "26 22.5 2.5 SMART FORTWO ELECTRIC DRIVE CABRIOLET 8 \n", - "27 22.5 2.5 SMART FORTWO ELECTRIC DRIVE COUPE 8 \n", - "28 21.7 2.4 TESLA MODEL S (60 kWh battery) 10 \n", - "29 23.2 2.6 TESLA MODEL S (70 kWh battery) 12 \n", - ".. ... ... ... ... ... \n", - "53 21.5 2.4 TESLA MODEL S P85D/P90D 12 \n", - "54 21 2.4 TESLA MODEL S P90D (Refresh) 12 \n", - "55 20 2.3 TESLA MODEL S P100D 12 \n", - "56 22.2 2.5 TESLA MODEL X 60D 10 \n", - "57 21.9 2.5 TESLA MODEL X 75D 12 \n", - "58 22.2 2.5 TESLA MODEL X 90D 12 \n", - "59 23.3 2.6 TESLA MODEL X P90D 12 \n", - "60 22.9 2.6 TESLA MODEL X P100D 12 \n", - "61 18.8 2.1 BMW i3 (60 Ah) 4 \n", - "62 19.7 2.2 BMW i3 (94 Ah) 5 \n", - "63 19 2.1 CHEVROLET BOLT EV 9.3 \n", - "64 21.8 2.5 FORD FOCUS ELECTRIC 5.5 \n", - "65 23 2.6 KIA SOUL EV 4 \n", - "66 20.5 2.3 MITSUBISHI i-MiEV 7 \n", - "67 20.7 2.3 NISSAN LEAF 6 \n", - "68 20.7 2.3 TESLA MODEL S (60 kWh battery) 10 \n", - "69 21 2.4 TESLA MODEL S (75 kWh battery) 12 \n", - "70 19.6 2.2 TESLA MODEL S 60D 10 \n", - "71 19.9 2.2 TESLA MODEL S 75D 12 \n", - "72 19.7 2.2 TESLA MODEL S 90D 12 \n", - "73 20.5 2.3 TESLA MODEL S 100D 12 \n", - "74 20.9 2.3 TESLA MODEL S P90D 12 \n", - "75 20 2.3 TESLA MODEL S P100D 12 \n", - "76 22.2 2.5 TESLA MODEL X 60D 10 \n", - "77 21.9 2.5 TESLA MODEL X 75D 12 \n", - "78 22.2 2.5 TESLA MODEL X 90D 12 \n", - "79 23.7 2.7 TESLA MODEL X 100D 12 \n", - "80 23.3 2.6 TESLA MODEL X P90D 12 \n", - "81 22.9 2.6 TESLA MODEL X P100D 12 \n", - "82 18.6 2.1 VOLKSWAGEN e-GOLF 5.3 \n", - "\n", - " smogRate vclass year \n", - "0 n/a 1.0 2012.0 \n", - "1 n/a 2.0 2012.0 \n", - "2 n/a 3.0 2013.0 \n", - "3 n/a 1.0 2013.0 \n", - "4 n/a 2.0 2013.0 \n", - "5 n/a 4.0 2013.0 \n", - "6 n/a 4.0 2013.0 \n", - "7 n/a 5.0 2013.0 \n", - "8 n/a 5.0 2013.0 \n", - "9 n/a 5.0 2013.0 \n", - "10 n/a 5.0 2013.0 \n", - "11 n/a 1.0 2014.0 \n", - "12 n/a 3.0 2014.0 \n", - "13 n/a 1.0 2014.0 \n", - "14 n/a 2.0 2014.0 \n", - "15 n/a 4.0 2014.0 \n", - "16 n/a 4.0 2014.0 \n", - "17 n/a 5.0 2014.0 \n", - "18 n/a 5.0 2014.0 \n", - "19 n/a 5.0 2014.0 \n", - "20 n/a 1.0 2015.0 \n", - "21 n/a 1.0 2015.0 \n", - "22 n/a 3.0 2015.0 \n", - "23 n/a 6.0 2015.0 \n", - "24 n/a 1.0 2015.0 \n", - "25 n/a 2.0 2015.0 \n", - "26 n/a 4.0 2015.0 \n", - "27 n/a 4.0 2015.0 \n", - "28 n/a 5.0 2015.0 \n", - "29 n/a 5.0 2015.0 \n", - ".. ... ... ... \n", - "53 n/a 5.0 2016.0 \n", - "54 n/a 5.0 2016.0 \n", - "55 n/a 5.0 2016.0 \n", - "56 n/a 7.0 2016.0 \n", - "57 n/a 7.0 2016.0 \n", - "58 n/a 7.0 2016.0 \n", - "59 n/a 7.0 2016.0 \n", - "60 n/a 7.0 2016.0 \n", - "61 10 1.0 2017.0 \n", - "62 10 1.0 2017.0 \n", - "63 10 6.0 2017.0 \n", - "64 10 3.0 2017.0 \n", - "65 10 6.0 2017.0 \n", - "66 10 1.0 2017.0 \n", - "67 10 2.0 2017.0 \n", - "68 10 5.0 2017.0 \n", - "69 10 5.0 2017.0 \n", - "70 10 5.0 2017.0 \n", - "71 10 5.0 2017.0 \n", - "72 10 5.0 2017.0 \n", - "73 10 5.0 2017.0 \n", - "74 10 5.0 2017.0 \n", - "75 10 5.0 2017.0 \n", - "76 10 7.0 2017.0 \n", - "77 10 7.0 2017.0 \n", - "78 10 7.0 2017.0 \n", - "79 10 7.0 2017.0 \n", - "80 10 7.0 2017.0 \n", - "81 10 7.0 2017.0 \n", - "82 10 3.0 2017.0 \n", - "\n", - "[83 rows x 17 columns]" - ] - }, - "execution_count": 52, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "db=db.reset_index(drop=True)\n", - "db" - ] - }, - { - "cell_type": "code", - "execution_count": 53, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "db.to_csv('Database.csv')\n", - "db.to_json('Databasejs.json')" - ] - }, - { - "cell_type": "code", - "execution_count": 56, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
cityEleccityGasco2co2Rateco2savedcombEleccombGasdistfuelhwyElechwyGasmakemodelrechargesmogRatevclassyearvehicle
016.91.90n/a211.10923718.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02012.0MITSUBISHI i-MiEV
119.32.20n/a216.06107221.12.4117B232.6NISSANLEAF7n/a2.02012.0NISSAN LEAF
2192.10n/a219.517627202.2122B21.12.4FORDFOCUS ELECTRIC4n/a3.02013.0FORD FOCUS ELECTRIC
316.91.90n/a209.61395718.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02013.0MITSUBISHI i-MiEV
419.32.20n/a214.56579221.12.4117B232.6NISSANLEAF7n/a2.02013.0NISSAN LEAF
517.21.90n/a224.46946219.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE CABRIOLET8n/a4.02013.0SMART FORTWO ELECTRIC DRIVE CABRIOLET
617.21.90n/a224.46946219.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE COUPE8n/a4.02013.0SMART FORTWO ELECTRIC DRIVE COUPE
722.42.50n/a229.42129722.22.5224B21.92.5TESLAMODEL S (40 kWh battery)6n/a5.02013.0TESLA MODEL S (40 kWh battery)
822.22.50n/a229.42129721.92.5335B21.72.4TESLAMODEL S (60 kWh battery)10n/a5.02013.0TESLA MODEL S (60 kWh battery)
923.82.70n/a229.42129723.62.6426B23.22.6TESLAMODEL S (85 kWh battery)12n/a5.02013.0TESLA MODEL S (85 kWh battery)
1023.92.70n/a229.42129723.62.6426B23.22.6TESLAMODEL S PERFORMANCE12n/a5.02013.0TESLA MODEL S PERFORMANCE
11161.80n/a208.11867817.82131B19.62.2CHEVROLETSPARK EV7n/a1.02014.0CHEVROLET SPARK EV
12192.10n/a218.022348202.2122B21.12.4FORDFOCUS ELECTRIC4n/a3.02014.0FORD FOCUS ELECTRIC
1316.91.90n/a208.11867818.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02014.0MITSUBISHI i-MiEV
1416.51.90n/a213.07051318.42.1135B20.82.3NISSANLEAF5n/a2.02014.0NISSAN LEAF
1517.21.90n/a222.97418319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE CABRIOLET8n/a4.02014.0SMART FORTWO ELECTRIC DRIVE CABRIOLET
1617.21.90n/a222.97418319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE COUPE8n/a4.02014.0SMART FORTWO ELECTRIC DRIVE COUPE
1722.22.50n/a227.92601821.92.5335B21.72.4TESLAMODEL S (60 kWh battery)10n/a5.02014.0TESLA MODEL S (60 kWh battery)
1823.82.70n/a227.92601823.62.6426B23.22.6TESLAMODEL S (85 kWh battery)12n/a5.02014.0TESLA MODEL S (85 kWh battery)
1923.92.70n/a227.92601823.62.6426B23.22.6TESLAMODEL S PERFORMANCE12n/a5.02014.0TESLA MODEL S PERFORMANCE
2015.21.70n/a206.62339816.81.9130B18.82.1BMWi34n/a1.02015.0BMW i3
21161.80n/a206.62339817.82131B19.62.2CHEVROLETSPARK EV7n/a1.02015.0CHEVROLET SPARK EV
22192.10n/a216.527068202.2122B21.12.4FORDFOCUS ELECTRIC4n/a3.02015.0FORD FOCUS ELECTRIC
2317.520n/a231.38257319.92.2149B22.72.6KIASOUL EV4n/a6.02015.0KIA SOUL EV
2416.91.90n/a206.62339818.72.1100B21.42.4MITSUBISHIi-MiEV7n/a1.02015.0MITSUBISHI i-MiEV
2516.51.90n/a211.57523318.42.1135B20.82.3NISSANLEAF5n/a2.02015.0NISSAN LEAF
2617.21.90n/a221.47890319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE CABRIOLET8n/a4.02015.0SMART FORTWO ELECTRIC DRIVE CABRIOLET
2717.21.90n/a221.47890319.62.2109B22.52.5SMARTFORTWO ELECTRIC DRIVE COUPE8n/a4.02015.0SMART FORTWO ELECTRIC DRIVE COUPE
2822.22.50n/a226.43073821.92.5335B21.72.4TESLAMODEL S (60 kWh battery)10n/a5.02015.0TESLA MODEL S (60 kWh battery)
2923.82.70n/a226.43073823.62.6377B23.22.6TESLAMODEL S (70 kWh battery)12n/a5.02015.0TESLA MODEL S (70 kWh battery)
.........................................................
5323.42.6010224.93545822.52.5407B21.52.4TESLAMODEL S P85D/P90D12n/a5.02016.0TESLA MODEL S P85D/P90D
5422.92.6010224.93545822.12.5435B212.4TESLAMODEL S P90D (Refresh)12n/a5.02016.0TESLA MODEL S P90D (Refresh)
5522.62.5010224.93545821.52.4507B202.3TESLAMODEL S P100D12n/a5.02016.0TESLA MODEL S P100D
56232.6010234.83912822.62.5322B22.22.5TESLAMODEL X 60D10n/a7.02016.0TESLA MODEL X 60D
57232.6010234.83912822.52.5383B21.92.5TESLAMODEL X 75D12n/a7.02016.0TESLA MODEL X 75D
5823.22.6010234.83912822.72.6414B22.22.5TESLAMODEL X 90D12n/a7.02016.0TESLA MODEL X 90D
5923.62.7010234.83912823.52.6402B23.32.6TESLAMODEL X P90D12n/a7.02016.0TESLA MODEL X P90D
6025.72.9010234.83912824.42.7465B22.92.6TESLAMODEL X P100D12n/a7.02016.0TESLA MODEL X P100D
6115.21.7010203.63283916.81.9130B18.82.1BMWi3 (60 Ah)4101.02017.0BMW i3 (60 Ah)
6216.21.8010203.63283917.82183B19.72.2BMWi3 (94 Ah)5101.02017.0BMW i3 (94 Ah)
6316.41.8010228.39201417.62383B192.1CHEVROLETBOLT EV9.3106.02017.0CHEVROLET BOLT EV
6417.72010213.53650919.62.2185B21.82.5FORDFOCUS ELECTRIC5.5103.02017.0FORD FOCUS ELECTRIC
6517.42010228.39201419.92.2150B232.6KIASOUL EV4106.02017.0KIA SOUL EV
6616.91.9010203.63283918.72.1100B20.52.3MITSUBISHIi-MiEV7101.02017.0MITSUBISHI i-MiEV
67171.9010208.58467418.62.1172B20.72.3NISSANLEAF6102.02017.0NISSAN LEAF
6821.52.4010223.44017921.12.4338B20.72.3TESLAMODEL S (60 kWh battery)10105.02017.0TESLA MODEL S (60 kWh battery)
6921.52.4010223.44017921.32.4401B212.4TESLAMODEL S (75 kWh battery)12105.02017.0TESLA MODEL S (75 kWh battery)
7020.62.3010223.44017920.22.3351B19.62.2TESLAMODEL S 60D10105.02017.0TESLA MODEL S 60D
7120.62.3010223.44017920.32.3417B19.92.2TESLAMODEL S 75D12105.02017.0TESLA MODEL S 75D
7220.62.3010223.44017920.22.3473B19.72.2TESLAMODEL S 90D12105.02017.0TESLA MODEL S 90D
7320.72.3010223.44017920.62.3539B20.52.3TESLAMODEL S 100D12105.02017.0TESLA MODEL S 100D
7422.82.6010223.440179222.5435B20.92.3TESLAMODEL S P90D12105.02017.0TESLA MODEL S P90D
7522.62.5010223.44017921.52.4507B202.3TESLAMODEL S P100D12105.02017.0TESLA MODEL S P100D
76232.6010233.34384922.62.5322B22.22.5TESLAMODEL X 60D10107.02017.0TESLA MODEL X 60D
77232.6010233.34384922.52.5383B21.92.5TESLAMODEL X 75D12107.02017.0TESLA MODEL X 75D
7823.22.6010233.34384922.72.6414B22.22.5TESLAMODEL X 90D12107.02017.0TESLA MODEL X 90D
7924.32.7010233.343849242.7475B23.72.7TESLAMODEL X 100D12107.02017.0TESLA MODEL X 100D
8023.62.7010233.34384923.52.6402B23.32.6TESLAMODEL X P90D12107.02017.0TESLA MODEL X P90D
8125.72.9010233.34384924.42.7465B22.92.6TESLAMODEL X P100D12107.02017.0TESLA MODEL X P100D
8216.81.9010213.53650917.42201B18.62.1VOLKSWAGENe-GOLF5.3103.02017.0VOLKSWAGEN e-GOLF
\n", - "

83 rows × 18 columns

\n", - "
" - ], - "text/plain": [ - " cityElec cityGas co2 co2Rate co2saved combElec combGas dist fuel \\\n", - "0 16.9 1.9 0 n/a 211.109237 18.7 2.1 100 B \n", - "1 19.3 2.2 0 n/a 216.061072 21.1 2.4 117 B \n", - "2 19 2.1 0 n/a 219.517627 20 2.2 122 B \n", - "3 16.9 1.9 0 n/a 209.613957 18.7 2.1 100 B \n", - "4 19.3 2.2 0 n/a 214.565792 21.1 2.4 117 B \n", - "5 17.2 1.9 0 n/a 224.469462 19.6 2.2 109 B \n", - "6 17.2 1.9 0 n/a 224.469462 19.6 2.2 109 B \n", - "7 22.4 2.5 0 n/a 229.421297 22.2 2.5 224 B \n", - "8 22.2 2.5 0 n/a 229.421297 21.9 2.5 335 B \n", - "9 23.8 2.7 0 n/a 229.421297 23.6 2.6 426 B \n", - "10 23.9 2.7 0 n/a 229.421297 23.6 2.6 426 B \n", - "11 16 1.8 0 n/a 208.118678 17.8 2 131 B \n", - "12 19 2.1 0 n/a 218.022348 20 2.2 122 B \n", - "13 16.9 1.9 0 n/a 208.118678 18.7 2.1 100 B \n", - "14 16.5 1.9 0 n/a 213.070513 18.4 2.1 135 B \n", - "15 17.2 1.9 0 n/a 222.974183 19.6 2.2 109 B \n", - "16 17.2 1.9 0 n/a 222.974183 19.6 2.2 109 B \n", - "17 22.2 2.5 0 n/a 227.926018 21.9 2.5 335 B \n", - "18 23.8 2.7 0 n/a 227.926018 23.6 2.6 426 B \n", - "19 23.9 2.7 0 n/a 227.926018 23.6 2.6 426 B \n", - "20 15.2 1.7 0 n/a 206.623398 16.8 1.9 130 B \n", - "21 16 1.8 0 n/a 206.623398 17.8 2 131 B \n", - "22 19 2.1 0 n/a 216.527068 20 2.2 122 B \n", - "23 17.5 2 0 n/a 231.382573 19.9 2.2 149 B \n", - "24 16.9 1.9 0 n/a 206.623398 18.7 2.1 100 B \n", - "25 16.5 1.9 0 n/a 211.575233 18.4 2.1 135 B \n", - "26 17.2 1.9 0 n/a 221.478903 19.6 2.2 109 B \n", - "27 17.2 1.9 0 n/a 221.478903 19.6 2.2 109 B \n", - "28 22.2 2.5 0 n/a 226.430738 21.9 2.5 335 B \n", - "29 23.8 2.7 0 n/a 226.430738 23.6 2.6 377 B \n", - ".. ... ... .. ... ... ... ... ... ... \n", - "53 23.4 2.6 0 10 224.935458 22.5 2.5 407 B \n", - "54 22.9 2.6 0 10 224.935458 22.1 2.5 435 B \n", - "55 22.6 2.5 0 10 224.935458 21.5 2.4 507 B \n", - "56 23 2.6 0 10 234.839128 22.6 2.5 322 B \n", - "57 23 2.6 0 10 234.839128 22.5 2.5 383 B \n", - "58 23.2 2.6 0 10 234.839128 22.7 2.6 414 B \n", - "59 23.6 2.7 0 10 234.839128 23.5 2.6 402 B \n", - "60 25.7 2.9 0 10 234.839128 24.4 2.7 465 B \n", - "61 15.2 1.7 0 10 203.632839 16.8 1.9 130 B \n", - "62 16.2 1.8 0 10 203.632839 17.8 2 183 B \n", - "63 16.4 1.8 0 10 228.392014 17.6 2 383 B \n", - "64 17.7 2 0 10 213.536509 19.6 2.2 185 B \n", - "65 17.4 2 0 10 228.392014 19.9 2.2 150 B \n", - "66 16.9 1.9 0 10 203.632839 18.7 2.1 100 B \n", - "67 17 1.9 0 10 208.584674 18.6 2.1 172 B \n", - "68 21.5 2.4 0 10 223.440179 21.1 2.4 338 B \n", - "69 21.5 2.4 0 10 223.440179 21.3 2.4 401 B \n", - "70 20.6 2.3 0 10 223.440179 20.2 2.3 351 B \n", - "71 20.6 2.3 0 10 223.440179 20.3 2.3 417 B \n", - "72 20.6 2.3 0 10 223.440179 20.2 2.3 473 B \n", - "73 20.7 2.3 0 10 223.440179 20.6 2.3 539 B \n", - "74 22.8 2.6 0 10 223.440179 22 2.5 435 B \n", - "75 22.6 2.5 0 10 223.440179 21.5 2.4 507 B \n", - "76 23 2.6 0 10 233.343849 22.6 2.5 322 B \n", - "77 23 2.6 0 10 233.343849 22.5 2.5 383 B \n", - "78 23.2 2.6 0 10 233.343849 22.7 2.6 414 B \n", - "79 24.3 2.7 0 10 233.343849 24 2.7 475 B \n", - "80 23.6 2.7 0 10 233.343849 23.5 2.6 402 B \n", - "81 25.7 2.9 0 10 233.343849 24.4 2.7 465 B \n", - "82 16.8 1.9 0 10 213.536509 17.4 2 201 B \n", - "\n", - " hwyElec hwyGas make model recharge \\\n", - "0 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "1 23 2.6 NISSAN LEAF 7 \n", - "2 21.1 2.4 FORD FOCUS ELECTRIC 4 \n", - "3 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "4 23 2.6 NISSAN LEAF 7 \n", - "5 22.5 2.5 SMART FORTWO ELECTRIC DRIVE CABRIOLET 8 \n", - "6 22.5 2.5 SMART FORTWO ELECTRIC DRIVE COUPE 8 \n", - "7 21.9 2.5 TESLA MODEL S (40 kWh battery) 6 \n", - "8 21.7 2.4 TESLA MODEL S (60 kWh battery) 10 \n", - "9 23.2 2.6 TESLA MODEL S (85 kWh battery) 12 \n", - "10 23.2 2.6 TESLA MODEL S PERFORMANCE 12 \n", - "11 19.6 2.2 CHEVROLET SPARK EV 7 \n", - "12 21.1 2.4 FORD FOCUS ELECTRIC 4 \n", - "13 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "14 20.8 2.3 NISSAN LEAF 5 \n", - "15 22.5 2.5 SMART FORTWO ELECTRIC DRIVE CABRIOLET 8 \n", - "16 22.5 2.5 SMART FORTWO ELECTRIC DRIVE COUPE 8 \n", - "17 21.7 2.4 TESLA MODEL S (60 kWh battery) 10 \n", - "18 23.2 2.6 TESLA MODEL S (85 kWh battery) 12 \n", - "19 23.2 2.6 TESLA MODEL S PERFORMANCE 12 \n", - "20 18.8 2.1 BMW i3 4 \n", - "21 19.6 2.2 CHEVROLET SPARK EV 7 \n", - "22 21.1 2.4 FORD FOCUS ELECTRIC 4 \n", - "23 22.7 2.6 KIA SOUL EV 4 \n", - "24 21.4 2.4 MITSUBISHI i-MiEV 7 \n", - "25 20.8 2.3 NISSAN LEAF 5 \n", - "26 22.5 2.5 SMART FORTWO ELECTRIC DRIVE CABRIOLET 8 \n", - "27 22.5 2.5 SMART FORTWO ELECTRIC DRIVE COUPE 8 \n", - "28 21.7 2.4 TESLA MODEL S (60 kWh battery) 10 \n", - "29 23.2 2.6 TESLA MODEL S (70 kWh battery) 12 \n", - ".. ... ... ... ... ... \n", - "53 21.5 2.4 TESLA MODEL S P85D/P90D 12 \n", - "54 21 2.4 TESLA MODEL S P90D (Refresh) 12 \n", - "55 20 2.3 TESLA MODEL S P100D 12 \n", - "56 22.2 2.5 TESLA MODEL X 60D 10 \n", - "57 21.9 2.5 TESLA MODEL X 75D 12 \n", - "58 22.2 2.5 TESLA MODEL X 90D 12 \n", - "59 23.3 2.6 TESLA MODEL X P90D 12 \n", - "60 22.9 2.6 TESLA MODEL X P100D 12 \n", - "61 18.8 2.1 BMW i3 (60 Ah) 4 \n", - "62 19.7 2.2 BMW i3 (94 Ah) 5 \n", - "63 19 2.1 CHEVROLET BOLT EV 9.3 \n", - "64 21.8 2.5 FORD FOCUS ELECTRIC 5.5 \n", - "65 23 2.6 KIA SOUL EV 4 \n", - "66 20.5 2.3 MITSUBISHI i-MiEV 7 \n", - "67 20.7 2.3 NISSAN LEAF 6 \n", - "68 20.7 2.3 TESLA MODEL S (60 kWh battery) 10 \n", - "69 21 2.4 TESLA MODEL S (75 kWh battery) 12 \n", - "70 19.6 2.2 TESLA MODEL S 60D 10 \n", - "71 19.9 2.2 TESLA MODEL S 75D 12 \n", - "72 19.7 2.2 TESLA MODEL S 90D 12 \n", - "73 20.5 2.3 TESLA MODEL S 100D 12 \n", - "74 20.9 2.3 TESLA MODEL S P90D 12 \n", - "75 20 2.3 TESLA MODEL S P100D 12 \n", - "76 22.2 2.5 TESLA MODEL X 60D 10 \n", - "77 21.9 2.5 TESLA MODEL X 75D 12 \n", - "78 22.2 2.5 TESLA MODEL X 90D 12 \n", - "79 23.7 2.7 TESLA MODEL X 100D 12 \n", - "80 23.3 2.6 TESLA MODEL X P90D 12 \n", - "81 22.9 2.6 TESLA MODEL X P100D 12 \n", - "82 18.6 2.1 VOLKSWAGEN e-GOLF 5.3 \n", - "\n", - " smogRate vclass year vehicle \n", - "0 n/a 1.0 2012.0 MITSUBISHI i-MiEV \n", - "1 n/a 2.0 2012.0 NISSAN LEAF \n", - "2 n/a 3.0 2013.0 FORD FOCUS ELECTRIC \n", - "3 n/a 1.0 2013.0 MITSUBISHI i-MiEV \n", - "4 n/a 2.0 2013.0 NISSAN LEAF \n", - "5 n/a 4.0 2013.0 SMART FORTWO ELECTRIC DRIVE CABRIOLET \n", - "6 n/a 4.0 2013.0 SMART FORTWO ELECTRIC DRIVE COUPE \n", - "7 n/a 5.0 2013.0 TESLA MODEL S (40 kWh battery) \n", - "8 n/a 5.0 2013.0 TESLA MODEL S (60 kWh battery) \n", - "9 n/a 5.0 2013.0 TESLA MODEL S (85 kWh battery) \n", - "10 n/a 5.0 2013.0 TESLA MODEL S PERFORMANCE \n", - "11 n/a 1.0 2014.0 CHEVROLET SPARK EV \n", - "12 n/a 3.0 2014.0 FORD FOCUS ELECTRIC \n", - "13 n/a 1.0 2014.0 MITSUBISHI i-MiEV \n", - "14 n/a 2.0 2014.0 NISSAN LEAF \n", - "15 n/a 4.0 2014.0 SMART FORTWO ELECTRIC DRIVE CABRIOLET \n", - "16 n/a 4.0 2014.0 SMART FORTWO ELECTRIC DRIVE COUPE \n", - "17 n/a 5.0 2014.0 TESLA MODEL S (60 kWh battery) \n", - "18 n/a 5.0 2014.0 TESLA MODEL S (85 kWh battery) \n", - "19 n/a 5.0 2014.0 TESLA MODEL S PERFORMANCE \n", - "20 n/a 1.0 2015.0 BMW i3 \n", - "21 n/a 1.0 2015.0 CHEVROLET SPARK EV \n", - "22 n/a 3.0 2015.0 FORD FOCUS ELECTRIC \n", - "23 n/a 6.0 2015.0 KIA SOUL EV \n", - "24 n/a 1.0 2015.0 MITSUBISHI i-MiEV \n", - "25 n/a 2.0 2015.0 NISSAN LEAF \n", - "26 n/a 4.0 2015.0 SMART FORTWO ELECTRIC DRIVE CABRIOLET \n", - "27 n/a 4.0 2015.0 SMART FORTWO ELECTRIC DRIVE COUPE \n", - "28 n/a 5.0 2015.0 TESLA MODEL S (60 kWh battery) \n", - "29 n/a 5.0 2015.0 TESLA MODEL S (70 kWh battery) \n", - ".. ... ... ... ... \n", - "53 n/a 5.0 2016.0 TESLA MODEL S P85D/P90D \n", - "54 n/a 5.0 2016.0 TESLA MODEL S P90D (Refresh) \n", - "55 n/a 5.0 2016.0 TESLA MODEL S P100D \n", - "56 n/a 7.0 2016.0 TESLA MODEL X 60D \n", - "57 n/a 7.0 2016.0 TESLA MODEL X 75D \n", - "58 n/a 7.0 2016.0 TESLA MODEL X 90D \n", - "59 n/a 7.0 2016.0 TESLA MODEL X P90D \n", - "60 n/a 7.0 2016.0 TESLA MODEL X P100D \n", - "61 10 1.0 2017.0 BMW i3 (60 Ah) \n", - "62 10 1.0 2017.0 BMW i3 (94 Ah) \n", - "63 10 6.0 2017.0 CHEVROLET BOLT EV \n", - "64 10 3.0 2017.0 FORD FOCUS ELECTRIC \n", - "65 10 6.0 2017.0 KIA SOUL EV \n", - "66 10 1.0 2017.0 MITSUBISHI i-MiEV \n", - "67 10 2.0 2017.0 NISSAN LEAF \n", - "68 10 5.0 2017.0 TESLA MODEL S (60 kWh battery) \n", - "69 10 5.0 2017.0 TESLA MODEL S (75 kWh battery) \n", - "70 10 5.0 2017.0 TESLA MODEL S 60D \n", - "71 10 5.0 2017.0 TESLA MODEL S 75D \n", - "72 10 5.0 2017.0 TESLA MODEL S 90D \n", - "73 10 5.0 2017.0 TESLA MODEL S 100D \n", - "74 10 5.0 2017.0 TESLA MODEL S P90D \n", - "75 10 5.0 2017.0 TESLA MODEL S P100D \n", - "76 10 7.0 2017.0 TESLA MODEL X 60D \n", - "77 10 7.0 2017.0 TESLA MODEL X 75D \n", - "78 10 7.0 2017.0 TESLA MODEL X 90D \n", - "79 10 7.0 2017.0 TESLA MODEL X 100D \n", - "80 10 7.0 2017.0 TESLA MODEL X P90D \n", - "81 10 7.0 2017.0 TESLA MODEL X P100D \n", - "82 10 3.0 2017.0 VOLKSWAGEN e-GOLF \n", - "\n", - "[83 rows x 18 columns]" - ] - }, - "execution_count": 56, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "db[\"vehicle\"]=db[\"make\"].astype(str) + \" \"+db[\"model\"].astype(str)\n", - "db" - ] - }, - { - "cell_type": "code", - "execution_count": 57, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
cityEleccityGasco2co2Rateco2savedcombEleccombGasdistfuelhwyElechwyGasrechargesmogRatevclassyearvehicle
016.91.90n/a211.10923718.72.1100B21.42.47n/a1.02012.0MITSUBISHI i-MiEV
119.32.20n/a216.06107221.12.4117B232.67n/a2.02012.0NISSAN LEAF
2192.10n/a219.517627202.2122B21.12.44n/a3.02013.0FORD FOCUS ELECTRIC
316.91.90n/a209.61395718.72.1100B21.42.47n/a1.02013.0MITSUBISHI i-MiEV
419.32.20n/a214.56579221.12.4117B232.67n/a2.02013.0NISSAN LEAF
517.21.90n/a224.46946219.62.2109B22.52.58n/a4.02013.0SMART FORTWO ELECTRIC DRIVE CABRIOLET
617.21.90n/a224.46946219.62.2109B22.52.58n/a4.02013.0SMART FORTWO ELECTRIC DRIVE COUPE
722.42.50n/a229.42129722.22.5224B21.92.56n/a5.02013.0TESLA MODEL S (40 kWh battery)
822.22.50n/a229.42129721.92.5335B21.72.410n/a5.02013.0TESLA MODEL S (60 kWh battery)
923.82.70n/a229.42129723.62.6426B23.22.612n/a5.02013.0TESLA MODEL S (85 kWh battery)
1023.92.70n/a229.42129723.62.6426B23.22.612n/a5.02013.0TESLA MODEL S PERFORMANCE
11161.80n/a208.11867817.82131B19.62.27n/a1.02014.0CHEVROLET SPARK EV
12192.10n/a218.022348202.2122B21.12.44n/a3.02014.0FORD FOCUS ELECTRIC
1316.91.90n/a208.11867818.72.1100B21.42.47n/a1.02014.0MITSUBISHI i-MiEV
1416.51.90n/a213.07051318.42.1135B20.82.35n/a2.02014.0NISSAN LEAF
1517.21.90n/a222.97418319.62.2109B22.52.58n/a4.02014.0SMART FORTWO ELECTRIC DRIVE CABRIOLET
1617.21.90n/a222.97418319.62.2109B22.52.58n/a4.02014.0SMART FORTWO ELECTRIC DRIVE COUPE
1722.22.50n/a227.92601821.92.5335B21.72.410n/a5.02014.0TESLA MODEL S (60 kWh battery)
1823.82.70n/a227.92601823.62.6426B23.22.612n/a5.02014.0TESLA MODEL S (85 kWh battery)
1923.92.70n/a227.92601823.62.6426B23.22.612n/a5.02014.0TESLA MODEL S PERFORMANCE
2015.21.70n/a206.62339816.81.9130B18.82.14n/a1.02015.0BMW i3
21161.80n/a206.62339817.82131B19.62.27n/a1.02015.0CHEVROLET SPARK EV
22192.10n/a216.527068202.2122B21.12.44n/a3.02015.0FORD FOCUS ELECTRIC
2317.520n/a231.38257319.92.2149B22.72.64n/a6.02015.0KIA SOUL EV
2416.91.90n/a206.62339818.72.1100B21.42.47n/a1.02015.0MITSUBISHI i-MiEV
2516.51.90n/a211.57523318.42.1135B20.82.35n/a2.02015.0NISSAN LEAF
2617.21.90n/a221.47890319.62.2109B22.52.58n/a4.02015.0SMART FORTWO ELECTRIC DRIVE CABRIOLET
2717.21.90n/a221.47890319.62.2109B22.52.58n/a4.02015.0SMART FORTWO ELECTRIC DRIVE COUPE
2822.22.50n/a226.43073821.92.5335B21.72.410n/a5.02015.0TESLA MODEL S (60 kWh battery)
2923.82.70n/a226.43073823.62.6377B23.22.612n/a5.02015.0TESLA MODEL S (70 kWh battery)
...................................................
5323.42.6010224.93545822.52.5407B21.52.412n/a5.02016.0TESLA MODEL S P85D/P90D
5422.92.6010224.93545822.12.5435B212.412n/a5.02016.0TESLA MODEL S P90D (Refresh)
5522.62.5010224.93545821.52.4507B202.312n/a5.02016.0TESLA MODEL S P100D
56232.6010234.83912822.62.5322B22.22.510n/a7.02016.0TESLA MODEL X 60D
57232.6010234.83912822.52.5383B21.92.512n/a7.02016.0TESLA MODEL X 75D
5823.22.6010234.83912822.72.6414B22.22.512n/a7.02016.0TESLA MODEL X 90D
5923.62.7010234.83912823.52.6402B23.32.612n/a7.02016.0TESLA MODEL X P90D
6025.72.9010234.83912824.42.7465B22.92.612n/a7.02016.0TESLA MODEL X P100D
6115.21.7010203.63283916.81.9130B18.82.14101.02017.0BMW i3 (60 Ah)
6216.21.8010203.63283917.82183B19.72.25101.02017.0BMW i3 (94 Ah)
6316.41.8010228.39201417.62383B192.19.3106.02017.0CHEVROLET BOLT EV
6417.72010213.53650919.62.2185B21.82.55.5103.02017.0FORD FOCUS ELECTRIC
6517.42010228.39201419.92.2150B232.64106.02017.0KIA SOUL EV
6616.91.9010203.63283918.72.1100B20.52.37101.02017.0MITSUBISHI i-MiEV
67171.9010208.58467418.62.1172B20.72.36102.02017.0NISSAN LEAF
6821.52.4010223.44017921.12.4338B20.72.310105.02017.0TESLA MODEL S (60 kWh battery)
6921.52.4010223.44017921.32.4401B212.412105.02017.0TESLA MODEL S (75 kWh battery)
7020.62.3010223.44017920.22.3351B19.62.210105.02017.0TESLA MODEL S 60D
7120.62.3010223.44017920.32.3417B19.92.212105.02017.0TESLA MODEL S 75D
7220.62.3010223.44017920.22.3473B19.72.212105.02017.0TESLA MODEL S 90D
7320.72.3010223.44017920.62.3539B20.52.312105.02017.0TESLA MODEL S 100D
7422.82.6010223.440179222.5435B20.92.312105.02017.0TESLA MODEL S P90D
7522.62.5010223.44017921.52.4507B202.312105.02017.0TESLA MODEL S P100D
76232.6010233.34384922.62.5322B22.22.510107.02017.0TESLA MODEL X 60D
77232.6010233.34384922.52.5383B21.92.512107.02017.0TESLA MODEL X 75D
7823.22.6010233.34384922.72.6414B22.22.512107.02017.0TESLA MODEL X 90D
7924.32.7010233.343849242.7475B23.72.712107.02017.0TESLA MODEL X 100D
8023.62.7010233.34384923.52.6402B23.32.612107.02017.0TESLA MODEL X P90D
8125.72.9010233.34384924.42.7465B22.92.612107.02017.0TESLA MODEL X P100D
8216.81.9010213.53650917.42201B18.62.15.3103.02017.0VOLKSWAGEN e-GOLF
\n", - "

83 rows × 16 columns

\n", - "
" - ], - "text/plain": [ - " cityElec cityGas co2 co2Rate co2saved combElec combGas dist fuel \\\n", - "0 16.9 1.9 0 n/a 211.109237 18.7 2.1 100 B \n", - "1 19.3 2.2 0 n/a 216.061072 21.1 2.4 117 B \n", - "2 19 2.1 0 n/a 219.517627 20 2.2 122 B \n", - "3 16.9 1.9 0 n/a 209.613957 18.7 2.1 100 B \n", - "4 19.3 2.2 0 n/a 214.565792 21.1 2.4 117 B \n", - "5 17.2 1.9 0 n/a 224.469462 19.6 2.2 109 B \n", - "6 17.2 1.9 0 n/a 224.469462 19.6 2.2 109 B \n", - "7 22.4 2.5 0 n/a 229.421297 22.2 2.5 224 B \n", - "8 22.2 2.5 0 n/a 229.421297 21.9 2.5 335 B \n", - "9 23.8 2.7 0 n/a 229.421297 23.6 2.6 426 B \n", - "10 23.9 2.7 0 n/a 229.421297 23.6 2.6 426 B \n", - "11 16 1.8 0 n/a 208.118678 17.8 2 131 B \n", - "12 19 2.1 0 n/a 218.022348 20 2.2 122 B \n", - "13 16.9 1.9 0 n/a 208.118678 18.7 2.1 100 B \n", - "14 16.5 1.9 0 n/a 213.070513 18.4 2.1 135 B \n", - "15 17.2 1.9 0 n/a 222.974183 19.6 2.2 109 B \n", - "16 17.2 1.9 0 n/a 222.974183 19.6 2.2 109 B \n", - "17 22.2 2.5 0 n/a 227.926018 21.9 2.5 335 B \n", - "18 23.8 2.7 0 n/a 227.926018 23.6 2.6 426 B \n", - "19 23.9 2.7 0 n/a 227.926018 23.6 2.6 426 B \n", - "20 15.2 1.7 0 n/a 206.623398 16.8 1.9 130 B \n", - "21 16 1.8 0 n/a 206.623398 17.8 2 131 B \n", - "22 19 2.1 0 n/a 216.527068 20 2.2 122 B \n", - "23 17.5 2 0 n/a 231.382573 19.9 2.2 149 B \n", - "24 16.9 1.9 0 n/a 206.623398 18.7 2.1 100 B \n", - "25 16.5 1.9 0 n/a 211.575233 18.4 2.1 135 B \n", - "26 17.2 1.9 0 n/a 221.478903 19.6 2.2 109 B \n", - "27 17.2 1.9 0 n/a 221.478903 19.6 2.2 109 B \n", - "28 22.2 2.5 0 n/a 226.430738 21.9 2.5 335 B \n", - "29 23.8 2.7 0 n/a 226.430738 23.6 2.6 377 B \n", - ".. ... ... .. ... ... ... ... ... ... \n", - "53 23.4 2.6 0 10 224.935458 22.5 2.5 407 B \n", - "54 22.9 2.6 0 10 224.935458 22.1 2.5 435 B \n", - "55 22.6 2.5 0 10 224.935458 21.5 2.4 507 B \n", - "56 23 2.6 0 10 234.839128 22.6 2.5 322 B \n", - "57 23 2.6 0 10 234.839128 22.5 2.5 383 B \n", - "58 23.2 2.6 0 10 234.839128 22.7 2.6 414 B \n", - "59 23.6 2.7 0 10 234.839128 23.5 2.6 402 B \n", - "60 25.7 2.9 0 10 234.839128 24.4 2.7 465 B \n", - "61 15.2 1.7 0 10 203.632839 16.8 1.9 130 B \n", - "62 16.2 1.8 0 10 203.632839 17.8 2 183 B \n", - "63 16.4 1.8 0 10 228.392014 17.6 2 383 B \n", - "64 17.7 2 0 10 213.536509 19.6 2.2 185 B \n", - "65 17.4 2 0 10 228.392014 19.9 2.2 150 B \n", - "66 16.9 1.9 0 10 203.632839 18.7 2.1 100 B \n", - "67 17 1.9 0 10 208.584674 18.6 2.1 172 B \n", - "68 21.5 2.4 0 10 223.440179 21.1 2.4 338 B \n", - "69 21.5 2.4 0 10 223.440179 21.3 2.4 401 B \n", - "70 20.6 2.3 0 10 223.440179 20.2 2.3 351 B \n", - "71 20.6 2.3 0 10 223.440179 20.3 2.3 417 B \n", - "72 20.6 2.3 0 10 223.440179 20.2 2.3 473 B \n", - "73 20.7 2.3 0 10 223.440179 20.6 2.3 539 B \n", - "74 22.8 2.6 0 10 223.440179 22 2.5 435 B \n", - "75 22.6 2.5 0 10 223.440179 21.5 2.4 507 B \n", - "76 23 2.6 0 10 233.343849 22.6 2.5 322 B \n", - "77 23 2.6 0 10 233.343849 22.5 2.5 383 B \n", - "78 23.2 2.6 0 10 233.343849 22.7 2.6 414 B \n", - "79 24.3 2.7 0 10 233.343849 24 2.7 475 B \n", - "80 23.6 2.7 0 10 233.343849 23.5 2.6 402 B \n", - "81 25.7 2.9 0 10 233.343849 24.4 2.7 465 B \n", - "82 16.8 1.9 0 10 213.536509 17.4 2 201 B \n", - "\n", - " hwyElec hwyGas recharge smogRate vclass year \\\n", - "0 21.4 2.4 7 n/a 1.0 2012.0 \n", - "1 23 2.6 7 n/a 2.0 2012.0 \n", - "2 21.1 2.4 4 n/a 3.0 2013.0 \n", - "3 21.4 2.4 7 n/a 1.0 2013.0 \n", - "4 23 2.6 7 n/a 2.0 2013.0 \n", - "5 22.5 2.5 8 n/a 4.0 2013.0 \n", - "6 22.5 2.5 8 n/a 4.0 2013.0 \n", - "7 21.9 2.5 6 n/a 5.0 2013.0 \n", - "8 21.7 2.4 10 n/a 5.0 2013.0 \n", - "9 23.2 2.6 12 n/a 5.0 2013.0 \n", - "10 23.2 2.6 12 n/a 5.0 2013.0 \n", - "11 19.6 2.2 7 n/a 1.0 2014.0 \n", - "12 21.1 2.4 4 n/a 3.0 2014.0 \n", - "13 21.4 2.4 7 n/a 1.0 2014.0 \n", - "14 20.8 2.3 5 n/a 2.0 2014.0 \n", - "15 22.5 2.5 8 n/a 4.0 2014.0 \n", - "16 22.5 2.5 8 n/a 4.0 2014.0 \n", - "17 21.7 2.4 10 n/a 5.0 2014.0 \n", - "18 23.2 2.6 12 n/a 5.0 2014.0 \n", - "19 23.2 2.6 12 n/a 5.0 2014.0 \n", - "20 18.8 2.1 4 n/a 1.0 2015.0 \n", - "21 19.6 2.2 7 n/a 1.0 2015.0 \n", - "22 21.1 2.4 4 n/a 3.0 2015.0 \n", - "23 22.7 2.6 4 n/a 6.0 2015.0 \n", - "24 21.4 2.4 7 n/a 1.0 2015.0 \n", - "25 20.8 2.3 5 n/a 2.0 2015.0 \n", - "26 22.5 2.5 8 n/a 4.0 2015.0 \n", - "27 22.5 2.5 8 n/a 4.0 2015.0 \n", - "28 21.7 2.4 10 n/a 5.0 2015.0 \n", - "29 23.2 2.6 12 n/a 5.0 2015.0 \n", - ".. ... ... ... ... ... ... \n", - "53 21.5 2.4 12 n/a 5.0 2016.0 \n", - "54 21 2.4 12 n/a 5.0 2016.0 \n", - "55 20 2.3 12 n/a 5.0 2016.0 \n", - "56 22.2 2.5 10 n/a 7.0 2016.0 \n", - "57 21.9 2.5 12 n/a 7.0 2016.0 \n", - "58 22.2 2.5 12 n/a 7.0 2016.0 \n", - "59 23.3 2.6 12 n/a 7.0 2016.0 \n", - "60 22.9 2.6 12 n/a 7.0 2016.0 \n", - "61 18.8 2.1 4 10 1.0 2017.0 \n", - "62 19.7 2.2 5 10 1.0 2017.0 \n", - "63 19 2.1 9.3 10 6.0 2017.0 \n", - "64 21.8 2.5 5.5 10 3.0 2017.0 \n", - "65 23 2.6 4 10 6.0 2017.0 \n", - "66 20.5 2.3 7 10 1.0 2017.0 \n", - "67 20.7 2.3 6 10 2.0 2017.0 \n", - "68 20.7 2.3 10 10 5.0 2017.0 \n", - "69 21 2.4 12 10 5.0 2017.0 \n", - "70 19.6 2.2 10 10 5.0 2017.0 \n", - "71 19.9 2.2 12 10 5.0 2017.0 \n", - "72 19.7 2.2 12 10 5.0 2017.0 \n", - "73 20.5 2.3 12 10 5.0 2017.0 \n", - "74 20.9 2.3 12 10 5.0 2017.0 \n", - "75 20 2.3 12 10 5.0 2017.0 \n", - "76 22.2 2.5 10 10 7.0 2017.0 \n", - "77 21.9 2.5 12 10 7.0 2017.0 \n", - "78 22.2 2.5 12 10 7.0 2017.0 \n", - "79 23.7 2.7 12 10 7.0 2017.0 \n", - "80 23.3 2.6 12 10 7.0 2017.0 \n", - "81 22.9 2.6 12 10 7.0 2017.0 \n", - "82 18.6 2.1 5.3 10 3.0 2017.0 \n", - "\n", - " vehicle \n", - "0 MITSUBISHI i-MiEV \n", - "1 NISSAN LEAF \n", - "2 FORD FOCUS ELECTRIC \n", - "3 MITSUBISHI i-MiEV \n", - "4 NISSAN LEAF \n", - "5 SMART FORTWO ELECTRIC DRIVE CABRIOLET \n", - "6 SMART FORTWO ELECTRIC DRIVE COUPE \n", - "7 TESLA MODEL S (40 kWh battery) \n", - "8 TESLA MODEL S (60 kWh battery) \n", - "9 TESLA MODEL S (85 kWh battery) \n", - "10 TESLA MODEL S PERFORMANCE \n", - "11 CHEVROLET SPARK EV \n", - "12 FORD FOCUS ELECTRIC \n", - "13 MITSUBISHI i-MiEV \n", - "14 NISSAN LEAF \n", - "15 SMART FORTWO ELECTRIC DRIVE CABRIOLET \n", - "16 SMART FORTWO ELECTRIC DRIVE COUPE \n", - "17 TESLA MODEL S (60 kWh battery) \n", - "18 TESLA MODEL S (85 kWh battery) \n", - "19 TESLA MODEL S PERFORMANCE \n", - "20 BMW i3 \n", - "21 CHEVROLET SPARK EV \n", - "22 FORD FOCUS ELECTRIC \n", - "23 KIA SOUL EV \n", - "24 MITSUBISHI i-MiEV \n", - "25 NISSAN LEAF \n", - "26 SMART FORTWO ELECTRIC DRIVE CABRIOLET \n", - "27 SMART FORTWO ELECTRIC DRIVE COUPE \n", - "28 TESLA MODEL S (60 kWh battery) \n", - "29 TESLA MODEL S (70 kWh battery) \n", - ".. ... \n", - "53 TESLA MODEL S P85D/P90D \n", - "54 TESLA MODEL S P90D (Refresh) \n", - "55 TESLA MODEL S P100D \n", - "56 TESLA MODEL X 60D \n", - "57 TESLA MODEL X 75D \n", - "58 TESLA MODEL X 90D \n", - "59 TESLA MODEL X P90D \n", - "60 TESLA MODEL X P100D \n", - "61 BMW i3 (60 Ah) \n", - "62 BMW i3 (94 Ah) \n", - "63 CHEVROLET BOLT EV \n", - "64 FORD FOCUS ELECTRIC \n", - "65 KIA SOUL EV \n", - "66 MITSUBISHI i-MiEV \n", - "67 NISSAN LEAF \n", - "68 TESLA MODEL S (60 kWh battery) \n", - "69 TESLA MODEL S (75 kWh battery) \n", - "70 TESLA MODEL S 60D \n", - "71 TESLA MODEL S 75D \n", - "72 TESLA MODEL S 90D \n", - "73 TESLA MODEL S 100D \n", - "74 TESLA MODEL S P90D \n", - "75 TESLA MODEL S P100D \n", - "76 TESLA MODEL X 60D \n", - "77 TESLA MODEL X 75D \n", - "78 TESLA MODEL X 90D \n", - "79 TESLA MODEL X 100D \n", - "80 TESLA MODEL X P90D \n", - "81 TESLA MODEL X P100D \n", - "82 VOLKSWAGEN e-GOLF \n", - "\n", - "[83 rows x 16 columns]" - ] - }, - "execution_count": 57, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "db.drop([\"make\",\"model\"],inplace=True,axis=1)\n", - "db" - ] - }, - { - "cell_type": "code", - "execution_count": 58, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "db.to_csv('Database.csv')\n", - "db.to_json('Databasejs.json')" - ] - } - ], - "metadata": { - "anaconda-cloud": {}, - "kernelspec": { - "display_name": "Python [default]", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.5.2" - } - }, - "nbformat": 4, - "nbformat_minor": 1 -}