0% found this document useful (0 votes)
12 views28 pages

Ip Project Ansh

The document outlines a project on data analysis and visualization of alcohol consumption, submitted by Ansh Ochani under the guidance of Ms. Subhi Sharma at Alpine Academy for the academic year 2024-25. It includes sections on the purpose, scope, technology used, code, and findings related to alcohol consumption patterns across demographics. The project aims to provide insights for policymakers and promote awareness about responsible drinking habits.

Uploaded by

anshplaysdumb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views28 pages

Ip Project Ansh

The document outlines a project on data analysis and visualization of alcohol consumption, submitted by Ansh Ochani under the guidance of Ms. Subhi Sharma at Alpine Academy for the academic year 2024-25. It includes sections on the purpose, scope, technology used, code, and findings related to alcohol consumption patterns across demographics. The project aims to provide insights for policymakers and promote awareness about responsible drinking habits.

Uploaded by

anshplaysdumb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

ALPINE ACADEMY

2024 - 25
PROJECT ON -
DATA ANALYSIS AND DATA VISUALISATION ON
ALCOHOL CONSUMPTION

A DISSERTATION SUBMITTED FOR THE PARTIAL FULFILLMENT


OF INFORMATICS PRACTICES {065} PROJECT

Guided By - Submitted By -
Ms. Subhi Sharma Ansh Ochani
PGT (INFORMATICS PRACTICES) CLASS XII
Roll no. -
CERTIFICATE
This is to certify that Ansh Ochani of Class 12 has
successfully completed the project work on "Data
analysis and data visualization on Alcohol
Consumption" for subject Informatics Practices
(065) of class

XII of the Central Board of Secondary Education in


the year 2024-25 under the guidance of Ms.
Shubhi Sharma. It is further certified that this
project is genuine and not a reproduction of any
project previously done or submitted.

Internal External Principal


Examiner Examiner

____________ ____________ ____________

Date - School seal -


ACKNOWLEDGEMENT

I Vinit Verma , would like to take this opportunity to express my


sincere gratitude to everyone who supported me in the successful
completion of this project.

I extend my heartfelt thanks to my supervisor, Ms. Subhi Sharma, for


her valuable guidance, insightful feedback, and encouragement
throughout the course of this project. Her expertise and suggestions
were pivotal in helping me achieve our objectives.

I would also like to thank Alpine Academy for providing me with the
necessary resources and a conducive environment to carry out this
work.

Lastly, i am immensely grateful to my family and friends for their


unwavering support and encouragement, which motivated me to
overcome challenges and strive for excellence.
Thank you to everyone who contributed to the success of this project.

Vinit Verma
CONTENTS

a) Introduction ....2
b) Purpose of the project ....3
c) Scope of the project ....4
d) Introduction to technology ....5-6
e) Hardware and software requirements ....7-8
f) Code ....9-22
g) Output ....23-27
h) Advantages of the project ....28
i) Limitations of the project ....29
j) Conclusion ....30
1<) Bibliography ....31

Page no -1
INTRODUCTION
_____________________________________________________

Alcohol Consumption
Who consumes the most alcohol? How has
consumption changed over time? And what are
the health impacts?

Alcohol has historically, and continues to, hold


an important role in social engagement and
bonding for many. Social drinking or moderate
alcohol consumption for many is pleasurable.
However, alcohol consumption – especially in
excess – is linked to a number of negative
outcomes: as a risk factor for diseases and
health impacts, crime, road incidents, and, for
some, alcohol dependence.
This topic page looks at the data on global
patterns of alcohol consumption, patterns of
drinking, beverage types, the prevalence of
alcoholism, and consequences, including crime,
mortality, and road incidents.

page no - 2
Purpose of the Project
The purpose of this project is to analyze and visualize data related to
alcohol consumption to gain a deeper understanding of trends,
patterns, and factors influencing drinking habits across different
demographics. By leveraging data analysis techniques, this project aims
to provide meaningful insights into the correlation between alcohol
consumption and various socio-economic, cultural, and geographical
factors.

Through data visualization, we aim to present complex data in an


easily digestible format, making it accessible to a wide audience,
including policymakers, researchers, and the general public. Our
goal is to highlight the significant factors affecting alcohol
consumption, identify high-risk patterns, and promote awareness
about responsible drinking habits.

By the end of this project, we hope to contribute valuable


information to the ongoing discussions about public health,
societal behavior, and the regulation of alcohol use. We also
intend to explore ways in which data can be used to influence
better decision-making in alcohol-related policies and
interventions.

page no - 3
Scope of the Project

This project focuses on analyzing alcohol consumption data


to identify trends and factors influencing drinking behaviors
across various demographics. It will involve collecting
publicly available datasets, which include information on
consumption patterns, socio-economic factors, and
geographic locations. The project will apply statistical
techniques to uncover correlations and patterns in alcohol
use, such as regional differences and age-related trends.

Data visualization will play a key role in presenting the


findings, using charts and graphs to make complex data
easy to interpret. The goal is to generate actionable insights
that can inform public health initiatives and policies related
to alcohol consumption. However, the analysis will be limited
by the quality and scope of the available data. Ultimately,
this project aims to contribute to a better understanding of
alcohol consumption and support informed decision-making
in alcohol-related interventions.

page no - 4
INTRODUCTION TO TECHNOLOGY

-PYTHON:

Python is an interpreted, object-oriented, high-level programming language


with dynamic semantics. Its high-level built in data structures, combined with
dynamic typing and dynamic binding. It was created by Guido van Rossum in
1991.

➤ It is used for :-
web development (server-side),
software development,
mathematics,
system scripting.
➤ Why Python :-
Python works on different platforms (Windows, Mac, Linux, Raspberry Pi,
etc.).

Python has syntax that allows developers to write programs with

fewer lines than some other programming languages.


Python runs on an interpreter system, meaning that code can be executed as
soon as it is written.

Python libraries used are as follows :


✰ PANDAS
Pandas is an open-source python programming language. It is used for
data manipulation and analyze. In particular, it offers data
structures and operations for manipulating numerical tables and time
series. The name is derived from the term "panel data", an
econometrics term for data sets that include observations over
multiple time periods for the same individuals.

page no - 5
MATPLOTLIB

The matplotlib is a Python library that provides many interfaces and


functionality for 2D-graphics. In short, you can call matplotlib as a high-
quality plotting library of Python. It provides a very quick way to visualize
data from python. matplotlib library offers many different named
collections of methods; PyPlot is one such interface. PyPlot is a collection of
methods within matplotlib which allows user to construct 2D plots easily and
interactively.

NUMPY

NumPy is a Python library used for working with arrays. NumPy was
created in 2005 by Travis Oliphant. It is an open-source project and you
can use it freely. NumPy stands for Numerical Python. In Python we have
lists that serve the purpose of arrays, but they are slow to process.
NumPy aims to provide an array object that is up to 50x faster than
traditional Python lists. The array object in NumPy is called Nd array, it
provides a lot of supporting functions that make working with ND array
very easy.

CSV (Comma-Separated Values) :-


The CSV format refers to a tabular data that has been saved as
plaintext where data is separated by commas. It is a compact and
ubiquitous format for data storage. It can be opened in popular
spreadsheet packages like MS-Excel, etc. Nearly all spreadsheets
and databases support import/export to csv format.

page no - 6
Hardware and software requirements

• Hardware required:
Model: Dell Inspiron 3521
Category: Laptop computer
Processor: Intel(R) Core(TM) i3-3217U CPU @ 1.80GHz 1.80
GHz
System type: 64-bit operating system, x64-based processor
Installed memory (RAM): 8.00 GB (7.89 GB usable)

• Software required
Window10 Pro

•Word

page no - 7
➤ Python

➤ Libraries of python:

✓ Matplotlib
✓ NumPy
✓ Pandas

page no - 8
CODE
import pandas as pd
mport matplotlib.pyplot as plt

print()
print()

print("#####################################
################ WELCOME
#########################################
################")

print("")
print("")
print("----------------------------------------------------------------------------
-------------------------------------------")
print("")
print(" .. TOPIC :ALCOHOL CONSUMPTION
..")
print("")
print("-----------------------------------------------------------------------
------------------------------------------------")
print("")
print("")
print(" SCHOOL : ALPINE ACADEMY") print(" NAME : ANSH
OCHANI AND VINIT VERMA")
print(" CLASS : XII 'PCM'")
print(" ROLL NO : ")
print(" SUBJECT CODE : ")
print(" ")
print(" AIM : Aim of the project is to take data stored in csv or
database file and analyze using python libraries \n and generate
appropriate charts to visualise ")
page no - 9
print("")
print("")
print("")
print("--------------------------------------------------------------------------
---------------------------------------------")
data = pd.read_csv("alcohol_consumption_2000_2020.csv")

data.fillna(0, inplace=True

#the average alcohol consumption for each country from 2000 to


2020

year_columns = [str(year) for year in range(2000, 2021)]

data["Average_Consumption"] = data[year_columns].mean(axis=1)

# Categorize countries based on average alcohol consumption

def categorize(consumption):

if consumption < 2:
return "Low"
elif 2 <= consumption < 6:
return "Moderate"
else:
return "High"

data["Consumption_Category"] =data
["Average_Consumption"].apply(categorize)

page no - 10
# Group by Consumption Category for a summary

grouped_summary = data.groupby("Consumption_Category")
["Average_Consumption"].count()

print("\nSummary of Consumption Categories:")

print(grouped_summary)

# Group by Country and calculate the average alcohol consumption


over the years
grouped_by_country = data.groupby("Country Name")
[year_columns].mean()
grouped_by_country["Total_Consumption"] = data.groupby("Country
Name")[year_columns].sum().sum(axis=1)
grouped_by_country["Average_Consumption"] =
grouped_by_country.mean(axis=1)
top_20_countries =
grouped_by_country.sort_values(by="Average_Consumption",
ascending=False).head(20)
print("\nTop 20 Countries by Average Alcohol Consumption (2000-
2020):")
print(top_20_countries[["Average_Consumption",
"Total_Consumption"]])

#Group by Year

grouped_by_year = data[year_columns].mean()
print("\nAverage Alcohol Consumption per Year:")

print(grouped_by_year)

page no - 11
# User Input Analysis

country_name = input("Enter the name of the country to analyze:


").strip()

year = input("Enter the year to analyze (2000-2020): ").strip()

# Check if the country exists in the dataset and the year is valid

if country_name in data["Country Name"].tolist() and year in


year_columns:

country_data = data[data["Country Name"] == country_name]

consumption_value = country_data[year].values[0]

print(f"\nIn {year}, the alcohol consumption in


{country_name} was {consumption_value:.2f} liters per capita.")

# Visualization for the specific country and year

# Line Plot: Alcohol consumption for the specific country across


years

page no - 12
country_yearly = country_data[year_columns].values.flatten()

plt.figure(figsize=(10, 6))
plt.plot(year_columns, country_yearly, marker="o", color="blue",
label=country_name)

plt.title(f"Alcohol Consumption in {country_name} (2000-2020)")


plt.xlabel("Year")
plt.ylabel("Consumption (Liters per Capita)")
plt.grid(True)

plt.legend()
plt.show()

else:
print("Invalid country name or year. Please try again.")

# Line Plot: Average Alcohol Consumption per Year (Global)

plt.figure(figsize=(10, 6))

grouped_by_year.plot(marker="o", color="orange")

plt.title("Average Global Alcohol Consumption (2000-2020)")

plt.xlabel("Year")
plt.ylabel("Consumption (Liters per Capita)")
plt.grid(True)
plt.show()

page no - 13
# Save the categorized dataset to a new CSV file
output_file = "categorized_alcohol_consumption.csv"
data.to_csv(output_file, index=False)
print(f"\nCategorized dataset saved to: {output_file}")

# Additional Statistics & Visualizations

# 1. Country with the highest average alcohol consumption


max_consumption_country =
data.loc[data["Average_Consumption"].idxmax()]
print(f"\nCountry with the highest average alcohol consumption (2000-
2020): {max_consumption_country['Country Name']} -
{max_consumption_country['Average_Consumption']:.2f} liters per
capita")

# 2. Year with the highest growth in alcohol consumption

# Calculate the year-to-year growth in global alcohol consumption

global_growth = grouped_by_year.pct_change().fillna(0) * 100 #


Percentage change for each year
max_growth_year = global_growth.idxmax()

# Find the year with the highest growth


print(f"\nYear with the highest growth in global alcohol consumption:
{max_growth_year} - {global_growth[max_growth_year]:.2f}% growth")

page no - 14
# 3. Countries with the highest and lowest total alcohol consumption

# Sum the total consumption across all years for each country

data['Total_Consumption'] = data[year_columns].sum(axis=1)

max_total_consumption_country =
data.loc[data['Total_Consumption'].idxmax()]
min_total_consumption_country =
data.loc[data['Total_Consumption'].idxmin()]

print(f"\nCountry with the highest total alcohol consumption (2000-


2020): {max_total_consumption_country['Country Name']} -
{max_total_consumption_country['Total_Consumption']:.2f} liters")
print(f"Country with the lowest total alcohol consumption (2000-2020):
{min_total_consumption_country['Country Name']} -
{min_total_consumption_country['Total_Consumption']:.2f} liters")

# Group by Country and calculate the average alcohol consumption


over the years
grouped_by_country = data.groupby("Country Name")
[year_columns].mean()
grouped_by_country["Average_Consumption"] =
grouped_by_country[year_columns].mean(axis=1)

page no - 15
# 4. Bar chart comparing the countries with the highest average
alcohol consumption

top_10_countries =
grouped_by_country.sort_values(by="Average_Consumption",
ascending=False).head(10)
plt.figure(figsize=(10, 6))
top_10_countries["Average_Consumption"].plot(kind="bar",
color="skyblue")
plt.title("Top 10 Countries with Highest Average Alcohol Consumption
(2000-2020)")
plt.xlabel("Country")
plt.ylabel("Average Consumption (Liters per Capita)")
plt.xticks(rotation=45, ha="right")
plt.grid(True)
plt.show()

# 5. Plot the growth rate of alcohol consumption over the years


(global)

plt.figure(figsize=(10, 6))
global_growth.plot(marker="o", color="green")
plt.title("Growth Rate in Alcohol Consumption (2000-2020)")
plt.xlabel("Year")
plt.ylabel("Growth Rate (%)")
plt.grid(True)
plt.show()

page no - 16
OUTPUT

INTRODUCTION :-

Summary Of Consumption :-

page no - 17
Average Consumption by Country (Top 20)

Average Consumption by year (2000-2020)

page no - 18
Average Consumption by a particular country in perticular
year(ex-India , 2006)

Some Statistical Data

page no - 19
Graph of Alcohol Consumption By A Particular
Country (ex- India)

Graph of Average Global Alcohol Consumption

page no - 20
Graph of Top 10 Countries with Highest Average
Consumption

Graph of Growth Rate in Alcohol Consumption

page no - 21
Advantages of the Project
This project provides meaningful insights into alcohol consumption
patterns and the factors influencing drinking behavior across
various demographics. By leveraging data analysis and visualization
techniques, it simplifies complex datasets into easily
understandable visuals, enabling a wider audience, including
policymakers, researchers, and the general public, to engage with
the findings. These insights can inform targeted interventions and
public health campaigns aimed at reducing alcohol-related harm
and promoting responsible consumption.

Moreover, the project helps identify high-risk groups and regions,


allowing for more effective allocation of resources to address
health and social challenges linked to alcohol use. By providing a
structured approach to analyzing and presenting data, the project
also serves as a valuable foundation for future research on alcohol
consumption and its broader societal impacts. Overall, it
contributes to evidence-based decision-making and a deeper
understanding of drinking behaviors.

page no - 22
Limitations of the Project

While this project provides valuable insights, it is constrained by


certain limitations. The analysis relies on publicly available
datasets, which may not always be comprehensive, up-to-date, or
fully accurate. These limitations in data quality can affect the
depth and reliability of the findings. Additionally, the project
primarily focuses on quantitative analysis, which may not capture
qualitative aspects like cultural attitudes or personal motivations
influencing alcohol consumption.

The scope of the project is also limited to identifying trends and


correlations, without establishing direct causation between
variables. Furthermore, regional or demographic variations might
not be fully explored due to data gaps or inconsistencies. Despite
these limitations, the project offers a strong foundation for
understanding alcohol consumption trends and guiding further
research and policy efforts.

page no - 23
Conclusion
This project successfully analyzes and visualizes alcohol
consumption data, providing valuable insights into trends
and factors influencing drinking behaviors across various
demographics. By leveraging data analysis techniques and
creating clear visual representations, the project offers
actionable insights for policymakers, public health
organizations, and researchers.

Although the project is limited by the quality and scope


of the available data, it highlights significant patterns
and correlations that can guide targeted interventions
and future research. Ultimately, the project contributes
to a deeper understanding of alcohol consumption,
supporting evidence-based decision-making and efforts to
address alcohol-related health and social issues
effectively.

page no - 24
BIBLIOGRAPHY

https://ourworldindata.org

https:/www.google.com/%C2%A0

www.who.int/

page no - 25

You might also like