Ip - Report - Kuti Page
Ip - Report - Kuti Page
P Investigatory
project
Concert Booking
Report by:
Name:
Class:
Registration. No:
ACKNOWLEDGEMENT
Members:
Nirav Asher. N
Yashik S
Class:
XII – B
Teacher incharge:
Mrs. Veena
Project Overview
Python – A glimpse
About python and its
interface:
Python is an open-source, object-
oriented, high-level programming
language developed by Guido van
Rossum in 1991. It is an interpreted,
interactive language with pre-
compiled codes that can be
executed directly, and it is case-
sensitive. Python is known for its rich
library of predefined functions,
offering a clear and straightforward
syntax that makes programs easy to
understand and implement.
Python library:
The Python library includes a
collection of built-in modules that
allow users to perform various
functions without extensive coding.
Some widely used libraries for
scientific and analytical purposes are
NumPy, Pandas, and Matplotlib.
NumPy (short for Numerical Python)
is used for numerical calculations,
Pandas (derived from Panel Data)
assists with data manipulation and
analysis, and Matplotlib is commonly
used for data visualization.
Pandas:
Pandas is a powerful Python package
that provides fast, flexible, and
expressive data structures, making it
ideal for working with relational or
labelled data. Its purpose is to serve
as a fundamental high-level building
block for real-world data analysis in
Python. Built on top of the NumPy
library, Pandas is open-source and
optimized for high performance and
productivity. It provides various
structures and operations for
manipulating numerical data and
time series and is particularly useful
for handling relational data easily
and intuitively.
● Series: A Series is a one-
dimensional array that holds a
sequence of values of any data
type (int, float, list, string, etc.),
each associated with a numeric
index that starts from zero. The
index serves as a data label for
each value in the Series.
● DataFrame: A DataFrame is a
two-dimensional labelled
structure, like a table in MySQL,
containing both row and column
indices. In a Data Frame, each
column can store different types
of values such as numeric, string,
or Boolean. It is highly versatile
for data analysis and
manipulation.
CSV files:
A Comma Separated Value (CSV)
file is a text file where values are
separated by commas. The
read_csv() function loads data
from a file into a DataFrame,
while to_csv() saves a DataFrame
to a CSV file.
Matplotlib:
Matplotlib is a library used for
creating static, animated, and
interactive 2D plots or figures in
Python. The Pyplot module within
Matplotlib provides a collection of
functions for working with plots.
When the plot () function from
Pyplot is used, it automatically
generates the required figure for
the desired plot, displaying the
output in a figure window.
Pyplot:
Matplotlib's Pyplot interface is a
key tool for data visualization in
Python, containing various
functions for constructing 2D
plots efficiently. The plot ()
function, part of the Pyplot
module, creates the necessary
figure for the plot and displays
it, making it easy to visualize
data and generate graphical
insights.
Necessities
Hardware Requirements:
●
Laptop
● Printer
Software requirements:
● Microsoft word
● Microsoft Excel
● Python
Source code
import pandas as pd
import matplotlib.pyplot as plt
def display_menu():
print("Select the statistical analysis you want to see:")
print("1. Summary Statistics")
print("2. Total Ticket Sales")
print("3. Average Ticket Cost")
print("4. Total Attendees")
print("5. Distribution of Ticket Prices")
print("6. Ticket Sales vs. Attendees")
print("7. Top 5 Concerts by Ticket Sales")
print("8. Ticket Cost vs. Concert Name (Bar Chart)")
print("9. Average Ticket Price by Artist")
print("10. Distribution of Attendees")
print("11. Correlation between Ticket Sales and
Attendees")
print("12. Ticket Price Frequency (Histogram)")
print("13. Concerts with the Highest Number of
Attendees")
print("14. Average Ticket Cost for Each Artist")
print("15. Ticket Sales per Concert (Bar Chart)")
def show_summary_statistics():
print("\nSummary Statistics:")
print(df.describe())
def total_ticket_sales():
total_sales = (df['No of Attendees'] * df['ticket
cost']).sum()
print(f"\nTotal Ticket Sales: {total_sales}")
def average_ticket_cost():
avg_cost = df['ticket cost'].mean()
print(f"\nAverage Ticket Cost: {avg_cost}")
def total_attendees():
total = df['No of Attendees'].sum()
print(f"\nTotal Number of Attendees: {total}")
def distribution_of_ticket_prices():
plt.figure(figsize=(8,6))
plt.hist(df['ticket cost'], bins=10, color='skyblue',
edgecolor='black')
plt.title("Distribution of Ticket Prices")
plt.xlabel("Ticket Price")
plt.ylabel("Frequency")
plt.show()
def ticket_sales_vs_attendees():
plt.figure(figsize=(8,6))
plt.scatter(df['No of Attendees'], df['ticket cost'],
color='orange')
plt.title("Ticket Sales vs. Attendees")
plt.xlabel("Number of Attendees")
plt.ylabel("Ticket Cost")
plt.show()
def top_5_concerts_by_sales():
df['Total Sales'] = df['No of Attendees'] * df['ticket cost']
top_5 = df.sort_values(by='Total Sales',
ascending=False).head(5)
print("\nTop 5 Concerts by Ticket Sales:")
print(top_5[['Concert Name', 'Total Sales']])
def ticket_cost_vs_concert_name():
plt.figure(figsize=(10,6))
plt.bar(df['Concert Name'], df['ticket cost'], color='green')
plt.title("Ticket Cost vs. Concert Name")
plt.xlabel("Concert Name")
plt.ylabel("Ticket Cost")
plt.xticks(rotation=90)
plt.show()
def average_ticket_price_by_artist():
avg_price_artist = df.groupby('Artist Name')['ticket
cost'].mean()
avg_price_artist.plot(kind='bar', figsize=(10,6),
color='purple')
plt.title("Average Ticket Price by Artist")
plt.xlabel("Artist")
plt.ylabel("Average Ticket Price")
plt.xticks(rotation=45)
plt.show()
def distribution_of_attendees():
plt.figure(figsize=(8,6))
plt.hist(df['No of Attendees'], bins=10, color='cyan',
edgecolor='black')
plt.title("Distribution of Attendees")
plt.xlabel("Number of Attendees")
plt.ylabel("Frequency")
plt.show()
def correlation_ticket_sales_attendees():
df['Total Sales'] = df['No of Attendees'] * df['ticket cost']
correlation = df['Total Sales'].corr(df['No of Attendees'])
print(f"\nCorrelation between Ticket Sales and Attendees:
{correlation}")
def ticket_price_frequency():
plt.figure(figsize=(8,6))
plt.hist(df['ticket cost'], bins=15, color='magenta',
edgecolor='black')
plt.title("Ticket Price Frequency")
plt.xlabel("Ticket Price")
plt.ylabel("Frequency")
plt.show()
def concerts_with_highest_attendees():
top_concerts = df.sort_values(by='No of Attendees',
ascending=False).head(5)
print("\nConcerts with the Highest Number of Attendees:")
print(top_concerts[['Concert Name', 'No of Attendees']])
def average_ticket_cost_for_artist():
avg_cost = df.groupby('Artist Name')['ticket cost'].mean()
print("\nAverage Ticket Cost for Each Artist:")
print(avg_cost)
def ticket_sales_per_concert():
df['Total Sales'] = df['No of Attendees'] * df['ticket cost']
plt.figure(figsize=(12,8))
plt.bar(df['Concert Name'], df['Total Sales'], color='blue')
plt.title("Ticket Sales per Concert")
plt.xlabel("Concert Name")
plt.ylabel("Total Sales")
plt.xticks(rotation=90)
plt.show()
if choice == '1':
show_summary_statistics()
elif choice == '2':
total_ticket_sales()
elif choice == '3':
average_ticket_cost()
elif choice == '4':
total_attendees()
elif choice == '5':
distribution_of_ticket_prices()
elif choice == '6':
ticket_sales_vs_attendees()
elif choice == '7':
top_5_concerts_by_sales()
elif choice == '8':
ticket_cost_vs_concert_name()
elif choice == '9':
average_ticket_price_by_artist()
elif choice == '10':
distribution_of_attendees()
elif choice == '11':
correlation_ticket_sales_attendees()
elif choice == '12':
ticket_price_frequency()
elif choice == '13':
concerts_with_highest_attendees()
elif choice == '14':
average_ticket_cost_for_artist()
elif choice == '15':
ticket_sales_per_concert()
elif choice.lower() == 'exit':
break
else:
print("\nInvalid choice, please select again.")
Output Screen
1. Summary Statistics:
CONCERT
Serial No Concert Name Artist Name At ticket cost
0 1 Joshua Tree Tour U2 50000 3500
1 2 Music of the Spheres Coldplay 60000 5500
2 3 Diluminati Diljit Dosanjh 20000 4000
3 4 Feeding India Post Malone 20000 5000
4 5 Lollapalooza IND Imagine Dragons 60000 6000
5 6 Takeover Tour AP Dhillon 30000 3500
6 7 DNA World Tour Backstreet Boys 30000 4500
7 8 OnePlus Music Dua Lipa & Katy Perry 30000 7000
8 9 NH7 Weekender Various Artists 60000 3500
9 10 Arijit Concerts Arijit Singh 100000 5500
Select the statistical analysis you want to see:
1. Summary Statistics
4. Total Attendees
VISUAL ANALYSIS
Enter the number of the analysis you want to see (or 'exit' to
quit): 1
Summary Statistics:
1. Summary Statistics
4. Total Attendees
VISUAL ANALYSIS
Enter the number of the analysis you want to see (or 'exit' to
quit): 2
1. Summary Statistics
4. Total Attendees
VISUAL ANALYSIS
Enter the number of the analysis you want to see (or 'exit' to
quit): 3
4. Total attendees:
CONCERT
Serial No Concert Name Artist Name At ticket cost
0 1 Joshua Tree Tour U2 50000 3500
1 2 Music of the Spheres Coldplay 60000 5500
2 3 Diluminati Diljit Dosanjh 20000 4000
3 4 Feeding India Post Malone 20000 5000
4 5 Lollapalooza IND Imagine Dragons 60000 6000
5 6 Takeover Tour AP Dhillon 30000 3500
6 7 DNA World Tour Backstreet Boys 30000 4500
7 8 OnePlus Music Dua Lipa & Katy Perry 30000 7000
8 9 NH7 Weekender Various Artists 60000 3500
9 10 Arijit Concerts Arijit Singh 100000 5500
Select the statistical analysis you want to see:
1. Summary Statistics
4. Total Attendees
VISUAL ANALYSIS
Enter the number of the analysis you want to see (or 'exit' to
quit): 4
1. Summary Statistics
4. Total Attendees
VISUAL ANALYSIS
Enter the number of the analysis you want to see (or 'exit' to
quit): 5
1. Summary Statistics
4. Total Attendees
Enter the number of the analysis you want to see (or 'exit' to
quit): 6
1. Summary Statistics
4. Total Attendees
VISUAL ANALYSIS
Enter the number of the analysis you want to see (or 'exit' to
quit): 7
1. Summary Statistics
4. Total Attendees
VISUAL ANALYSIS
Enter the number of the analysis you want to see (or 'exit' to
quit): 8
1. Summary Statistics
4. Total Attendees
VISUAL ANALYSIS
Enter the number of the analysis you want to see (or 'exit' to
quit): 9
10. Ticket sales vs
attendees:
CONCERT
Serial No Concert Name Artist Name At ticket cost
0 1 Joshua Tree Tour U2 50000 3500
1 2 Music of the Spheres Coldplay 60000 5500
2 3 Diluminati Diljit Dosanjh 20000 4000
3 4 Feeding India Post Malone 20000 5000
4 5 Lollapalooza IND Imagine Dragons 60000 6000
5 6 Takeover Tour AP Dhillon 30000 3500
6 7 DNA World Tour Backstreet Boys 30000 4500
7 8 OnePlus Music Dua Lipa & Katy Perry 30000 7000
8 9 NH7 Weekender Various Artists 60000 3500
9 10 Arijit Concerts Arijit Singh 100000 5500
1. Summary Statistics
4. Total Attendees
VISUAL ANALYSIS
1. Summary Statistics
4. Total Attendees
VISUAL ANALYSIS
Enter the number of the analysis you want to see (or 'exit' to
quit): 11
1. Summary Statistics
4. Total Attendees
VISUAL ANALYSIS
Enter the number of the analysis you want to see (or 'exit' to
quit): 12
13. Distribution of
attendees:
CONCERT
Serial No Concert Name Artist Name At ticket cost
0 1 Joshua Tree Tour U2 50000 3500
1 2 Music of the Spheres Coldplay 60000 5500
2 3 Diluminati Diljit Dosanjh 20000 4000
3 4 Feeding India Post Malone 20000 5000
4 5 Lollapalooza IND Imagine Dragons 60000 6000
5 6 Takeover Tour AP Dhillon 30000 3500
6 7 DNA World Tour Backstreet Boys 30000 4500
7 8 OnePlus Music Dua Lipa & Katy Perry 30000 7000
14. 8 9 NH7 Weekender Various Artists 60000 3500
15. 9 10 Arijit Concerts Arijit Singh 100000 5500
1. Summary Statistics
4. Total Attendees
VISUAL ANALYSIS
1. Summary Statistics
4. Total Attendees
VISUAL ANALYSIS
Enter the number of the analysis you want to see (or 'exit' to
quit): 14
1. Summary Statistics
4. Total Attendees
VISUAL ANALYSIS
Enter the number of the analysis you want to see (or 'exit' to
quit): 15
Conclusion
In conclusion, this project provides significant
advantages by enhancing data-driven insights,
simplifying complex information through
effective visualization, and improving
accuracy in interpreting results. Additionally,
it enables clearer communication of findings,
making the data more accessible to diverse
audiences. Collectively, these benefits support
informed decision-making and lay a solid
foundation for future research.
Bibliography
● · NCERT. Informatics Practices
Textbook for Class XII. National Council
of Educational Research and Training.
● Book my show database.