Competition - Everyone Can Learn Python Scholarship
  • AI Chat
  • Code
  • Report
  • Spinner

    Everyone Can Learn Python Scholarship

    📖 Background

    The first "Everyone Can Learn Python" Scholarship from DataCamp is now open for entries.

    The challenges below test the Python and SQL skills you gained from Introduction to Python and Introduction to SQL and pair them with your existing problem-solving and creative thinking.

    The scholarship is open to people who have completed or are completing their secondary education and are preparing to pursue a degree in computer science or data science. Students preparing for graduate-level computer science or data science degrees are also welcome to apply.

    Summary

    data I

    1. Median engine size in liters: 3.0

    2. Average Fuel Consumption for Diesel (D): 8.84 L/100 km

    3. Average Fuel Consumption for Ethanol (E): 16.86 L/100 km

    4. Average Fuel Consumption for Regular Gasoline (X): 10.08 L/100 km

    5. Average Fuel Consumption for Premium Gasoline (Z): 11.42 L/100 km

    6. Correlation between fuel consumption and CO2 emissions: 0.9180515723870847

    7. We can see that there is a general trend of higher CO2 emissions for larger engine sizes and for vehicles in the SUV and pickup truck classes. On the other hand, smaller engine sizes and vehicles in the compact and subcompact car classes tend to have lower CO2 emissions. However, there is some overlap between the classes and engine sizes, indicating that other factors may also be important in determining a vehicle's CO2 emissions.

    8. MID-SIZE has lower average CO2 emissions than SUV - SMAL | Vehicle Class | Average CO2 emissions | | ------------------------ | --------------------- | | COMPACT | 216.679061 | | FULL-SIZE | 263.316119 | | MID-SIZE | 222.455428 | | MINICOMPACT | 236.607362 | | MINIVAN | 262.312500 | | PICKUP TRUCK - SMALL | 278.968553 | | PICKUP TRUCK - STANDARD | 301.513011 | | SPECIAL PURPOSE VEHICLE | 237.597403 | | STATION WAGON - MID-SIZE | 238.698113 | | STATION WAGON - SMALL | 200.067460 | | SUBCOMPACT | 246.448845 | | SUV - SMALL | 236.292523 | | SUV - STANDARD | 304.836735 | | TWO-SEATER | 277.454348 | | VAN - CARGO | 361.500000 | | VAN - PASSENGER | 397.212121 |

    9. Average CO2 emissions for all vehicles: 250.58469871360867

    10. Average CO2 emissions for vehicles with an engine size of 2.0 liters or smaller: 198.26783530370975

    11. Analysis of Engine Size, Fuel Consumption, and CO2 Emissions

    • From the pairplot, we can see that there is a positive correlation between engine size and both fuel consumption and CO2 emissions.
    • This means that larger engines tend to have higher fuel consumption and CO2 emissions.
    • Additionally, there is a strong positive correlation between fuel consumption and CO2 emissions, which is expected since CO2 emissions are directly related to the amount of fuel burned.
    • Based on these findings, it is important to consider the engine size when choosing a vehicle, as larger engines tend to have higher fuel consumption and CO2 emissions.
    • Additionally, choosing a vehicle with lower fuel consumption can help reduce CO2 emissions.
    1. There appears to be a negative relationship between fuel efficiency and CO2 emissions for the top 10 models. As fuel efficiency increases, CO2 emissions tend to decrease. However, there are some exceptions where a model with lower fuel efficiency has lower CO2 emissions than a model with higher fuel efficiency. Therefore, there may be other factors, such as engine size or weight, that also play a role in determining CO2 emissions.

    data II

    1. The most expensice item is Trek Domane SLR 9 Disc - 2018 its product is 155, brand id is 9 , category id 7 , model year 2018 and price 11999.99.
    2. The least expensice item is TStrider Classic 12 Balance Bike - 2018 its product is 1263 ,brand id is 6 , category id 1 , model year 2018 and price 89.99 .
    3. How many different products of each category does your company sell? | category_name | number of sold products | | ----------------------| ------------------------| | Children Bicycles | 59 | | Comfort Bicycles | 30 | | Cruisers Bicycles | 78 | | Cyclocross Bicycles | 10 | | Electric Bikes | 24 | | Mountain Bikes | 60 | | Road Bikes | 60 |
    4. Top three categories for highest average list price:
    category_nameprice
    Cruisers Bicycles78
    Mountain Bikes60
    Road Bikes60
    1. Top three brands with highest average list price:
    BrandPrice
    Trek2500.064
    Heller2172.997
    Surly1331.754
    1. How many products are in each category and what is the total revenue generated by each category?
    category_namenum_productstotal_revenue
    Children Bicycles5916979.41
    Comfort Bicycles3020463.7
    Cruisers Bicycles7856972.16
    Cyclocross Bicycles1025427.93
    Electric Bikes2478759.76
    Mountain Bikes6098985.44
    Road Bikes60190521.44
    1. How many products are in each brand and what is the total revenue generated by each brand?
    brand_namenum_productstotal_revenue
    Electra11889798.73
    Haro106219.9
    Heller36518.99
    Pure Cycles31327
    Ritchey1749.99
    Strider3629.97
    Sun Bicycles2312062.77
    Surly25
    Trek135337508.65

    💾 The data I

    You have access to seven years of CO2 emissions data for Canadian vehicles (source):

    • "Make" - The company that manufactures the vehicle.
    • "Model" - The vehicle's model.
    • "Vehicle Class" - Vehicle class by utility, capacity, and weight.
    • "Engine Size(L)" - The engine's displacement in liters.
    • "Cylinders" - The number of cylinders.
    • "Transmission" - The transmission type: A = Automatic, AM = Automatic Manual, AS = Automatic with select shift, AV = Continuously variable, M = Manual, 3 - 10 = the number of gears.
    • "Fuel Type" - The fuel type: X = Regular gasoline, Z = Premium gasoline, D = Diesel, E = Ethanol (E85), N = natural gas.
    • "Fuel Consumption Comb (L/100 km)" - Combined city/highway (55%/45%) fuel consumption in liters per 100 km (L/100 km).
    • "CO2 Emissions(g/km)" - The tailpipe carbon dioxide emissions in grams per kilometer for combined city and highway driving.

    The data comes from the Government of Canada's open data website.

    Explore the data

    Hidden code
    Hidden code

    💪 Challenge I

    Help your colleague gain insights on the type of vehicles that have lower CO2 emissions. Include: ​

    1. What is the median engine size in liters?
    2. What is the average fuel consumption for regular gasoline (Fuel Type = X), premium gasoline (Z), ethanol (E), and diesel (D)?
    3. What is the correlation between fuel consumption and CO2 emissions?
    4. Which vehicle class has lower average CO2 emissions, 'SUV - SMALL' or 'MID-SIZE'?
    5. What are the average CO2 emissions for all vehicles? For vehicles with an engine size of 2.0 liters or smaller?
    6. Any other insights you found during your analysis?

    What is the median engine size in liters?

    Hidden code