In [9]:
from bokeh.plotting import figure

from bokeh.io import output_notebook, show

import pandas as pd

from bokeh.plotting import ColumnDataSource

from bokeh.layouts import gridplot

data = pd.read_csv("CO2_passenger_cars_v12_withoutNaN.csv", encoding = 'latin2', low_memory=False)
    

#data VOLKSWAGEN
VOLKSWAGENMkg = data[data["Mk"] == "VOLKSWAGEN"]["m (kg)"]
VOLKSWAGENEmission = data[data["Mk"] == "VOLKSWAGEN"]["e (g/km)"]
#data PORSCHE
PORSCHEMkg = data[data["Mk"] == "PORSCHE"]["m (kg)"]
PORSCHEEmission = data[data["Mk"] == "PORSCHE"]["e (g/km)"]
#data TOYOTA
TOYOTAMkg = data[data["Mk"] == "TOYOTA"]["m (kg)"]
TOYOTAEmission = data[data["Mk"] == "TOYOTA"]["e (g/km)"]
#data MERCEDES AMG
AUDIMkg = data[data["Mk"] == "AUDI"]["m (kg)"]
AUDIEmission = data[data["Mk"] == "AUDI"]["e (g/km)"]


total_dadosMkg = len(VOLKSWAGENMkg) + len(PORSCHEMkg) + len(TOYOTAMkg) + len(AUDIMkg)
total_dadosEmission = len(VOLKSWAGENEmission) + len(PORSCHEEmission) + len(TOYOTAEmission) + len(AUDIEmission)
print("Total de dados analisdados m (kg): " + str(total_dadosMkg))
print("Total de dados analisdados e (g/km): " + str(total_dadosEmission))

#figures
p1 = figure(title='VOLKSWAGEN', x_axis_label='m (kg)', y_axis_label='e (g/km)')
p2 = figure(title='PORSCHE', x_axis_label='m (kg)', y_axis_label='e (g/km)')
p3 = figure(title='TOYOTA', x_axis_label='m (kg)', y_axis_label='e (g/km)')
p4 = figure(title='AUDI', x_axis_label='m (kg)', y_axis_label='e (g/km)')



#circles
p1.circle(VOLKSWAGENMkg,VOLKSWAGENEmission)
p2.circle(PORSCHEMkg,PORSCHEEmission)
p3.circle(TOYOTAMkg,TOYOTAEmission)
p4.circle(AUDIMkg,AUDIEmission)

#rows
row1 = [p1,p2]
row2 = [p3,p4]

# Create a gridplot using row1 and row2: layout
layout = gridplot([row1,row2],sizing_mode='scale_width')

# Link the x_range of p2 to p1: p2.x_range
p2.x_range = p1.x_range

# Link the y_range of p2 to p1: p2.y_range
p2.y_range = p1.y_range

# Link the x_range of p3 to p1: p3.x_range
p3.x_range = p1.x_range

# Link the y_range of p4 to p1: p4.y_range
p4.y_range = p1.y_range

# Call the output_notebook() 

output_notebook()
# Display the plot
show(layout)


Total de dados analisdados m (kg): 99713
Total de dados analisdados e (g/km): 99713
Loading BokehJS ...

Big Data Analytics from CO2 Passager Cars Emissions data (EU)

With the Big Data Analytics, the big data can be analyzed to find defaults and important information about a content. Helping to take decisions, Change strategies and discovering things that you do not thought about yet.

In this project, was used a big data from Europian Monitoring of CO2 emissions from passenger cars at 2015. This data is available at this link: http://www.eea.europa.eu/data-and-maps/data/co2-cars-emission-11

This data file was analyzed and all irrelevant data was deleted (null data, data out of context). At this data file, has many informations, but, for this project, was selected four car brands: TOYOTA, VOLKSWAGEN, PORSCHE, AUDI; and confronted the Vehicle mass with Specific CO2 Emissions ( m (kg) x e (g/km) ). To do this analysis 99713 data was used.

In a individual brands analysis, lighter cars (less 1.000kg) VOLKSWAGEM had larger indicies of CO2 emission, while between 1.000kg and 2.500kg, the emission revolves around 100-140e (g/km). The brand PORSCHE, between 1.000kg and 2.500, the emission revolves around 170-300e (g/km). The brand TOYOTA, between 1.000kg and 2.500kg, the emission revolves around 80-270e (g/km). The brand AUDI, between 1.000kg and 2.500kg, the emission revolves around 90-250e (g/km). So, the conclusion is that, the brand that less emitted CO2 between 1.000kg and 2.500kg was VOLKSWAGEN and, the brand that most emitted CO2 was TOYOTA and AUDI.


In [ ]: