<jupyter_start><jupyter_text>here we see the breakdown of energy usage by sector represented by a pie chart. The transport sector is our point of interest with a bar that represents the types of vehicles. We notice that the transport sector has an impactful size with road vehicles dominating by a large ammount<jupyter_code>data = pd.read_csv('data/transport-sector-co2-emissions-by-mode-in-the-sustainable-development-scenario-2000-2030.csv')
plt.figure(figsize=(15,6), tight_layout=False)

year = data.iloc[:,0]
passenger_vehicles = data.iloc[:,1]
aviation = data.iloc[:,2]
freight_vehicles = data.iloc[:,3]
rail = data.iloc[:,4]
shipping = data.iloc[:,5]
other = data.iloc[:,6]
index = np.arange(len(data))

graph1 = plt.bar(x=index, height=passenger_vehicles, color=colors[0], label='Passenger vehicles')
graph2 = plt.bar(x=index, height=aviation, color=colors[1], bottom=passenger_vehicles, label='Aviation')
graph3 = plt.bar(x=index, height=freight_vehicles, color=colors[2], bottom=passenger_vehicles+aviation, label='Freight vehicles')
graph4 = plt.bar(x=index, height=rail, color=colors[3], bottom=passenger_vehicles+aviation+freight_vehicles, label='Rail')
graph5 = plt.bar(x=index, height=shipping, color=colors[4], bottom=passenger_vehicles+aviation+freight_vehicles+rail, label='Shipping')
graph6 = plt.bar(x=index, height=other, color=colors[5], bottom=passenger_vehicles+aviation+freight_vehicles+rail+shipping, label='Other')

plt.xlabel('Year')
plt.ylabel('Gross tonnage (GT)')
plt.title('Transport sector CO2 emissions by mode')
plt.xticks(index, year)
plt.legend()
plt.show()<jupyter_output><empty_output><jupyter_text>Now when we look at the CO2 emmissions from transportation over the past 20 years, we can notice a gradual increase year by year. However, in a sustainable development scenario, we can could potentially reduce the ammount CO2 emmissions from transportations as the graph indicates.<jupyter_code>data = pd.read_csv('data/methods of transportation.csv')
plt.figure(figsize=(9,6), tight_layout=True)

type_of_vehicles = ['Electric', 'Plug-in hybrid', 'Hybrid', 'Gasoline']
methods_of_trans = data[data['Type of vehicle'].isin(type_of_vehicles)]

barplot = methods_of_trans.groupby(['Type of vehicle'], as_index=False).mean()[['Type of vehicle', 'Pounds of CO2 equivalent']]

plt.bar(barplot['Type of vehicle'], barplot['Pounds of CO2 equivalent'], color=colors[-4:])

plt.xlabel('Type of vehicle')
plt.ylabel('Pounds of CO2 equivalent')
plt.title('Annual emmissions per vehicle ')

plt.show()<jupyter_output><empty_output><jupyter_text>Considering how we have a variety of different types of cars in this day and age, it is imprtant to take into account that they produce varying ammounts of CO2. It is no surprise that gasoline cars emit less CO2 than hybrid and electric cars. However, the relative difference can be well illustrated in this graph<jupyter_code>with open('data/CO2ByCountry.csv', newline = '') as csvf:
    reader = csv.reader(csvf)
    next(reader)
    x = []
    y = []
    for row in reader:
        x.append(row[0])
        y.append(int(''.join(row[1].split(','))))

plt.figure(figsize=(12,6), tight_layout = True)
plt.title("CO2 Emissions by country in 2016")
plt.xlabel("Countries")
plt.ylabel("CO2 released (in 10 billion Metric Tons)")

for i in range(len(x)):
    plt.bar(x[i], y[i], color=colors[i])


plt.show()<jupyter_output><empty_output><jupyter_text>Thinking broadly, we organise the top 10 countries based on carbon emissions<jupyter_code>with open('data/NumberOfCars.csv', newline = '') as csvf:
    reader = csv.reader(csvf)
    x = []
    y = []
    for row in reader:
        x.append(row[0])
        y.append(int(''.join(row[2].split(','))))

plt.figure(figsize=(12,6), tight_layout = True)
plt.title("Number of Cars per country")
plt.xlabel("Countries")
plt.ylabel("Number of cars (In hundreds of millions)")

for i in range(len(x)):
    plt.bar(x[i], y[i], color=colors[i])

plt.show()<jupyter_output><empty_output><jupyter_text>This graph represents the top 10 countries based on the number of cars they have. Comparing this to the previous graph. We find tha there is a correlation between the numbers of cars in a country and the total CO2 emissions in that country.<jupyter_code>with open ("data/multiple_line.csv", newline = '') as csvf:
    reader = csv.reader(csvf)
    rows = list(reader)
    years = rows[0][1:]
    years.reverse()
    country = []
    data_full = []
    data = []
    for row in rows[1:]:
        country.append(row[0])
        for number in row[1:]:
            data.append(int(''.join(number.split(','))))
        data.reverse()
        data_full.append(data)
        data = []
        
plt.figure(figsize=(12,6), tight_layout = True)
cursor = 0
for i in country:
    plt.plot(years, data_full[cursor], label = i, linestyle="-")

    cursor += 1

plt.title("Vehicle production of the top 12 countries over the years")
plt.xlabel("Year")
plt.ylabel("Vehicle production (In ten millions)")

plt.legend()
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13428401663695783, 'fraction_numerical': 0.015844721727074667, 'mean_word_length': 5.234567901234568, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '590214', 'license': 'MIT', 'n_tokens_mistral': 1728, 'n_tokens_neox': 1653, 'n_words': 459, 'path': 'main.ipynb', 'repo_name': 'psycho-baller/CalgaryHacks', 'size': '5049'}