# Analysis and Visualization of Fuel Consumption Against CO 2 Emission Shakir Adeyemi Adeyemi Tewogbade an open source and it was collected from Fuel consumption ratings -Open Government Portal (canada.ca). Open data has consent for re-use and let researchers build on existing studies (Brandon and Weber, 2022). Our dataset includes the following variables: vehicle make, vehicle model, vehicle model year, make of vehicle, size of vehicle engine, transmission, cylinder, type of fuel, fuel consumed during movement in the city, fuel consumed in the highway, and emission values. For appropriate visualization, we have selected Python libraries like Num Py (computation of numerical values), pandas (loading and manipulating data), matplotlib (handling plots) and seaborn to carry out our analysis in Jupyter Notebook. Various types of graphs like line graph, bar chart, heat maps were plotted to answer the questions formulated from our dataset. It is important to use correct visualization techniques in data analysis (Xi and Xinyu, 2021). Visualization technique selected for data analysis will be good if it is efficient, suitable and expressive (Mackinlay, 1986. Schumann and Muller, 2000). Our visual analysis is being carried out on Jupyter notebook platform. Jupyter notebook allow us to create and share files which include texts, live codes and visualizations. Abstract-CO2 emission has an adverse effect on the environment and cause greenhouse effect with significant negative climatic changes. This subsequently lead global warming which hurts both human and crops. It is important for us to perform visual analysis with available dataset using Canada as a case study. # II. Background Author: e-mail: pingcommercial@gmail.com Jupyter is interactive and web-based platform where computational activities can be executed with visualization. With the notebook, users can view their codes outcomes in-line independent of other segment of the project work. Each cell containing lines of codes are seen with their corresponding outputs. To use Jupyter notebook for our study, we divided the process into four stages: # c) Bar Chart Also known as column chart. It is used to display categorical data either vertically or horizontally where value of each category is represented by corresponding bar. Bar chart is readily modifiable most times with colours to capture significance differences. These are seen in stacked bar chart and clustered bar chart. # d) Box Plot Box plots show extreme values, median and quartiles. While the plot is gotten from the interquartile range (length of the box) and median, the whisker moves the box to the minimum and maximum values without including the outliers. # e) Heat Map It is used to display relationship between columns as represented in matrix view mode. Visualization analysis is achieved through selection of appropriate coloring. Heat map is an excellent plot in displaying variance through many variables while patterns are formed. # IV. Analysis Data are raw fact based on occurrences in human daily life and its environment. One of the means of turning data into comprehensible information and knowledge is through visualization (Narra and Yashaswini, 2020). When there is huge amount of data, there will be difficulty in understanding facts in it. With existence of data visualization techniques, visual illustrations that reveal hidden insights can be readily created. Thus, this study will be answering the questions that do with fuel combustion and C02 emission considering different models of cars in Canada. 1. C02 trend in the years of study 2. What fuel type caused most emission? 3. What make of car produced most C02 emission during the period of study? 4. Which vehicle class considering fuel consumption produced most C02 emission ? # a) Data Collection The first step was to import the needed data in .csv file format to our working environment using Panda library. # Analysis and Visualization of Fuel Consumption Against Co2 Emission # Global Journal of Science Frontier Research ( H ) XXIII Issue VI Version I Year 2023 # © 2023 Global Journals Jupyter notebook exist in document format with three segments which are cells for marking down, cells for coding and result parts (Park and Sekerinski, 2018). The architectural design of Jupyter notebook is based on JavaScript browser which interacts with HTTP server through WebSocket. The webserver utilize tornado embedded in Python to relate incoming message to the kernel. kernel that provides appropriate outputs after processing of the messages and these are communicated through notebook web interface. The kernel is the core actor in carrying out execution of codes in the Notebook. In this work, our target is to write codes that import fuel consumption dataset in.csv, clean it, prepare it and perform visual analysis. As stated earlier our graphs and plots are achieved with aid of libraries with Python Jupyter with appropriate codes. Important graphs and plots that put answers to the questions posed by our fuel consumption dataset are: # a) Line Graphs Widely used visualization technique where independent variables and dependent variables are projected on X and Y axis. Various data points are joined to show appropriate line produced by selected The dataset imported was viewed using syntax df.head () to display the first five rows for our perusal. We checked our dataset after all the cleaning to be sure that it is reading for visualization. # III. Main Part # Analysis and Visualization of Fuel Consumption Against Co2 Emission # Global Journal of Science Frontier Research ( H ) XXIII Issue VI Version I Year 2023 # Analysis and Visualization of Fuel Consumption Against Co2 Emission # Global Journal of Science Frontier Research ( H ) XXIII Issue VI Version I Year 2023 d) Data Analysis The first set of plots with our dataset is to show trend in C02 emission from 2010 to 2014. The plot shows downward trend which support various governmental policies in reducing emission and greenhouse effect. The next visual analysis is setting up heat map to show interaction between our dataset attributes. # Figure 13: Heatmap Showing Correlation Among Variables It was observed from the heat map that there is high positive correlation between fuel consumptions, engine size and cylinders with C02. Thus, we extend our visualization to plotting of fuel types with C02. Moving forward, we produced another visual that display which of the vehicle make produced most emission. The graph (Fig. 16) shows that Bugatti lead in term of amount of C02 emission produced into the environment. Bugatti uses fuel type Z with more controlling impact CO2 emission as shown in Fig. 14 above. As identified by our heat map, interaction between engine size C02 emission is plotted using scatter plot through seaborn. From the display, there is a strong direct proportional relationship between the two variables. The bigger the engine size the higher the C02 emission. # Analysis and Visualization of Fuel Consumption Against Co2 Emission # Global Journal of Science Frontier Research ( H ) XXIII Issue VI Version I Year 2023 # Analysis and Visualization of Fuel Consumption Against Co2 Emission # Global Journal of Science Frontier Research ( H ) XXIII Issue VI Version I Year 2023 Analysis performed on the dataset will validate emission models as generated by the various attributes. The dataset contains 5359 records with 12 attributes and as such it is hard to see information the raw figures is speaking to. Representing the data on various visual plots allow us to see hidden information at ease. Ben and Rachel 2015, used applicable visualization techniques like column chart, pie chart, line plot to analyze fuel consumption data. Similarly, Bielaczyc, Szczotka and Woodburn 2019 used column chart to represent fuel type plot against C02 emission and contour map to display emission in certain locations with vehicle load and speed. # Analysis and Visualization of Fuel Consumption Against Co2 Emission # Global Journal of Science Research ( H ) XXIII Issue VI Version I Year 2023 # 59 © 2023 Global Journals # V. Discussion The application of bar charts (Fig. 15 &16) in our analysis has easily been achieved because of its robustness in representing categorical data, perhaps Cleveland's dot plot would have taken fewer spaces with improved aesthetic for plot like fuel type vs C02 emission. For simplicity each dot will be represented as 40 g/km of emission. Dot plot uses minimum ink to optimum effect and still deliver excellent design (Tufte, 1983. Dave, Jaap and Ian, 2005). Heat map has been widely used in many visualizations analysis due to its intuitive approach of colouring and ability to present interaction among variables in a single diagram. In work such as ours, we could have introduced our heat map after plotting table lens graphs. As asserted by Sinar 2015, table lens has a very high efficiency in yielding many interactions in a single plot while serving as starter in dataset visualization. Also, in addition to our heatmap, facet (Trellis) plots can be used to create additional interactions (sub-plots) for variables showing strong correlation from the map. # VI. Conclusion Data visualization has gained great popularity with advancement of software technology and variety of platforms. One of the popular platforms to create visualization is Jupyter notebook where cells for codes and visual displays are available on the interface. We have used data visualization to investigate controlling effects of fuel consumption on C02 emission. Variety of techniques such as line chart, bar chart, heat maps and scatter plot were used to analyze the field data in order to create informative patterns on level of influence of various variables on C02 emission. Our visual analysis revealed resultant effects of important variables that need to be curtailed to minimize C02 emission in the environment. This kind of study will assist policy makers to find effective solutions to climatic changes caused by vehicle movements. In as much as we have efficient visuals which produced graphical display of raw data., there are few exceptions. The exceptions were critically reviewed to create room for improvement. The improvement will yield visual that create more robust outcomes where concentrated interactions are revealed in our visuals and nicer aesthetic. # References Références Referencias ![technological development has led to few negative effects on the climate. Carbon Dioxide is the major compound accountable for climatic change (Nataly and Yiu, 2014). Consumption of automobile fuel produces CO2 emission globally. As claimed by USEAP 2022, a standard vehicle releases about 4.6 metric tonnes of CO2 annually. A study by Environment Canada in 2015 shown that private automobiles released 82 million tonnes of carbon dioxide in year 2013 alone. As noted by Carvaheira 2018, fuel consumption and CO2 emission of a particular vehicle is based on operating variables and design characteristics (mass, aerodynamics, tyres, auxiliary systems). Beyond vehicle operating variables and design characteristics, there are other factors mentioned by Fontara, Zacharof and Ciuffo, (2017) such as weather conditions, traffic conditions, road morphology, vehicle maintenance and driving style. The degree of causal effect of CO2 on the climate has warranted the need to study and analyze root causes based on available data that captured these variables and conditions. In this study, fuel consumption open data from 2010 to 2014 is used for visual analysis of influencing factors of CO2 emissions for new light-duty vehicles for retail sale in Canada. The data used is from](image-2.png "") 1![Figure 1: Jupyter Web Interface](image-3.png "Figure 1 :") 4![Figure 4: Checking the Dataset The unnamed columns (9, 10 and 11) were given right title.](image-4.png "Figure 4 :") 5![Figure 5: Renaming the Unnamed Columns in the Dataset](image-5.png "Figure 5 :") 6![Figure 6: Dropping Unnecessary Row](image-6.png "Figure 6 :") 7![Figure 7: Rechecking Our Dataset to Confirm the Row Has Been Updated Codes were run to confirm the data type represented by each column and existence of null in the whole dataset.](image-7.png "Figure 7 :") 3![Figure 3: Loading of Fuel Consumption Dataset b) Data CleaningThe dataset imported was viewed using syntax df.head () to display the first five rows for our perusal.](image-8.png "Figure 3 :") 8![Figure 8: Checking Out the Data Type](image-9.png "Figure 8 :") 9![Figure 9: Checking Out Missing Values](image-10.png "Figure 9 :") 10![Figure 10: Confirming That the Dataset is Properly Cleaned Columns are confirmed for uniqueness.](image-11.png "Figure 10 :") 11![Figure 11: Confirming Uniqueness of Value in "Make" Column](image-12.png "Figure 11 :") 12![Figure 12: Line Graph to Show Trend Between Year 2020 and 2014](image-13.png "Figure 12 :") 14![Figure 14: Bar Plot of C02 Emission Against Fuel Type The plot showed that fuel type E and Z yields more C02 emission during the period under study. In a similar manner we plotted vehicle class based on fuel consumption against C02 emission using seaborn library. The graph showed that Van passenger and Van cargo yielded highest number of C02 emission between 2010 to 2014. We can also infer that weight of the vehicle has determining effect on C02 emission. The bigger vehicles are seen towards the right with high value of emission. This supports proposal by Pagerit et al, 2006, Wohlecker et al 2007 and Bishop et al 2014 as mentioned in our introduction.](image-14.png "Figure 14 :") 15![Figure 15: Bar Plot of Vehicle Class With Fuel Consumption Against C02 Emission](image-15.png "Figure 15 :") 16![Figure 16: Bar Plot of Vehicle Make Against C02 Emission](image-16.png "Figure 16 :") 17![Figure 17: Scatter Plot C02 emission against Engine size](image-17.png "Figure 17 :") dataset. Line graphs show quick glance of upwardmovement (direct proportional) and downwardmovement (inverse proportional).b) Scatter Plot1. Launch the platform2. Load dataset3. Clean & process the data4. Analysis and VisualizationTo load, clean, process and analyze data,important libraries are used with Python Jupyter such as1. Panda-loading, reshaping, merging, slicing, sortingand aggregation of data through its special datastructure and operations. With Python, pandaperform efficiently with data structures (Rupal andKhushboo, 2022)2. NumPy-It is used for mathematical and numericalcomputation on python coding environment withcapabilities for quick array processing3. Matplotlib-a low-level library used for plotting graphsand it is a great alternative to MATLAB4. Seaborn-was developed by Michael Waskom in2012 to handle statistical plots. It is a high-levelsource unlike matplotlib with an improvement interms of aesthetics and readability. With seaborn,line of codes for making plots will be fewer compareto matplotlib. NEDC and WLTC-an overview and experimental results from market representative vehicles. IOP conference series: Earth and Environmental Science 214 012136. doi:10.1088/1755-1315/214/1/012136 3. Bishop, J., Martin W., and Boies, A. (2014). Cost effectiveness of alternative power-trains for reduced energy use and CO2 emissions in passenger vehicles. Appl Energy 2014: 124, 14 -61. 4. Brandon, L., and Nick, W. (2022). Ethics of open data. arXiv: 2205. https://doi.org/10.48550/arXiv.22 05.10402: [accessed on 19 November 2022]. 5. Carvalheira, P. (2018). A Model for the calculations of CO2 emissions and fuel consumption of a diesel engine driven car in the WEDC. Proceedings of the 1 st Iberic Conference on Theoretical and Experimental Mechanics and Materials. 11 th National Congress on Experimental Mechanics. ISBN: 978-989-20-8771-9 6. Dave, K., Jaap, J., and Ian, W. (2005). Designing Science graphs for data analysis and presentation. The bad, the good and the better. Science & Technical Publishing Department of Conservation Wellington, New Zealand. 7. Analysis1. Ben, S., and Rachel, M. (2015). Literature review:Real-world fuel consumption of heavy-duty vehiclesin the United States, China and European Union.The International Council on clean transportation.White paper.2. Belaczyc, P., Szczotka, A., and Woodburn, J.(2019). Carbon dioxide emissions and fuelconsumption from passenger cars tested over the Journal of Science Frontier Research ( H ) XXIII Issue VI Version I Year 2023 © 2023 Global Journals * HMuller W 2000 * AlljemeineVisualisierung-Grundlajen Methoden Springer-Verlag Berlin * A notebook format for the holistic design of embedded systems PSpencer SEmil Formal Integrated Development Environment EPTC 284 2018. 2018 Tool Paper * The visual display of quantitative information ETufte 1983 Graphics Press Cheshire, Connecticut * Greenhouse Gas Emissions from a typical passenger vehicle. Greenhouse Gas Emissions from a Typical Passenger Vehicle | US EPA Useap 2022. 21 November 2022 * Determination of weight elasticity of fuel economy for ICE hybrid and fuel cell vehicles RWohlecker MJohannaber MEspig 10.4271/2007-01-0343 SAE ?echnical Papeí 2007-01-0343 2007 * Data Visualization in Smart Grid and Low-Carbon energy systems: A review CXi CXinyu 10.1002/2050-7038.12889 International Transactions on Electrical Energy Systems 7 13 2021