Project
Project
Acknowledgements
Thank you to all who I could not mention for being part of this journey and contributing
towards the realization of this project.
Sincerely,
Ritwik Gupta
XII- A
2
Table of Contents
S. No.
Topic
Page
1.
ACKNOWLEDGEMENT
1
2.
SYSTEM SPECIFICATIONS
3
3.
SOFTWARE USED
4
4
ABOUT THE PROJECT
5
5
Main.py
6-7
6
CSV FILE
8
7
Menu.py
9
8
VISUALIZE
10
BAR CHART
11
LINE CHART
3
12
HORIZONTAL BARGRAPH
13
LINE CHART
14
System Specifications
Hardware:
Software:
5
Software Used
PYTHON
Python, established in 1991 by Guido van Rossum, stands out as a user-friendly and
adaptable high-level programming language widely embraced by both
novices and seasoned developers. Renowned for its readability and
uncomplicated syntax, Python employs whitespace indentation for code
structure, deviating from conventional symbols like curly brackets. This
unique approach fosters clean and visually accessible code.
Python accommodates diverse programming paradigms, including
procedural, object-oriented, and functional programming, providing
developers with the flexibility to choose the most suitable method
for their projects. The language boasts an extensive standard library,
offering a plethora of modules and packages that expedite development by providing pre-
built solutions for common tasks. Additionally, Python's collaborative and community-driven
nature has resulted in a vast ecosystem of third-party libraries and frameworks, exemplified
by Django for web development, NumPy for scientific computing, and TensorFlow for
machine learning.
Recognized for cross-platform compatibility, Python ensures seamless execution on various
operating systems without necessitating modifications. Its interpreted nature facilitates swift
development cycles and straightforward debugging. Python's applications span a wide
spectrum, encompassing web development, data science, artificial intelligence, and
automation.
Python's recent surge in popularity can be attributed to its pivotal role in emerging
technologies and disciplines, solidifying its standing as the preferred language for a diverse
array of programming tasks.
CSV
CSV, or Comma-Separated Values, is a widely used file format for storing and exchanging
tabular data in a plain text format. The simplicity and universality of CSV
make it a popular choice for data storage and interchange between different
applications. In a CSV file, each line typically represents a row of data, and
individual values within a row are separated by commas.
The structure of a CSV file is straightforward, making it human-readable
and easy to create and modify using a simple text editor. While commas
are the most common delimiter, other characters like tabs or semicolons
can also be used depending on the specific requirements.
CSV files find extensive use in various domains, including data analysis, data import/export,
and spreadsheet applications. They provide a convenient way to represent structured data,
such as database exports or spreadsheet content, without the complexity of proprietary file
6
formats. Many programming languages, including Python, offer built-in libraries and
modules for efficiently reading and writing data in CSV format, further contributing to its
widespread adoption in software development.
Main.py
CODE:
import pandas as pd
import matplotlib.pyplot as plt
import menu as d
choice = d.main_menu()
aa=pd.read_csv(r"C:\Users\ritwi\Desktop\Grade 12\IP Project\Files\csvfile.csv")
while True:
if choice == "visualize": # Menu for choosing type of graph to see
print("Enter Choice to View the Type of Chart")
print("1 Bar-Chart \n2 Line-Chart \n3 Horizontal Bar-Chart \n4 Histogram \n5 Go back
to the Main Menu")
c=int(input(" Desired Type of Chart : "))
if c == 1:
aa.plot(kind="bar",x='name', width=0.7)
aa.xlabel='name of bird'
aa.ylabel='winter-2021'
plt.title("Bird Statistics Comparision in An Area over a Period of Time")
plt.show()
elif c == 2:
aa.plot()
aa.xlabel = 'name of bird'
aa.ylabel = 'winter-2021'
plt.title("Bird Statistics Comparision in An Area over a Period of Time")
plt.show()
elif c == 3:
aa.plot(kind="barh", x='name', width=1.0)
aa.xlabel='name of bird'
aa.ylabel='winter-2021'
plt.title("Bird Statistics Comparision in An Area over a Period of Time")
plt.show()
elif c == 4:
aa.plot(kind="hist",x='winter-2021', bins=15, histtype="step")
aa.xlabel='name of bird'
aa.ylabel='winter-2021'
plt.title("Bird Statistics Comparision in An Area over a Period of Time")
plt.show()
elif c == 5:
choice=d.main_menu()
else:
print("wrong choice")
break
8
break
9
CSV FILE
10
menu.py
CODE:
def main_menu():
print("visualize --to visualize data in csv:")
print("read --to read a csv file")
print("deleteR --to delete a row from csv file")
print("addC --to add column to csv file")
print("deleteC --to delete a column from csv file")
print("viewC --to view a column from csv file")
print("viewR --to view a row from csv file")
print("append --to append a row in csv file")
print()
print()
ch=input("\nEnter your choice to process:")
return(ch)
OUTPUT:
11
VISUALIZE
CODE:
choice = d.main_menu()
aa=pd.read_csv(r"C:\Users\ritwi\Desktop\Grade 12\IP Project\Files\csvfile.csv")
while True:
if choice == "visualize": # Menu for choosing type of graph to see
print("Enter Choice to View the Type of Chart")
print("1 Bar-Chart \n2 Line-Chart \n3 Horizontal Bar-Chart \n4 Histogram \n5 Go back
to the Main Menu")
c=int(input(" Desired Type of Chart : "))
OUTPUT:
12
1. Bar-Chart
CODE:
if c == 1:
aa.plot(kind="bar",x='name', width=0.7)
aa.xlabel='name of bird'
aa.ylabel='winter-2021'
plt.title("Bird Statistics Comparision in An Area over a Period of Time")
plt.show()
OUTPUT
13
2. Line-Chart
CODE:
elif c == 2:
aa.plot()
aa.xlabel = 'name of bird'
aa.ylabel = 'winter-2021'
plt.title("Bird Statistics Comparision in An Area over a Period of Time")
plt.show()
OUTPUT
14
3. Horizontal Bar-Graph
CODE:
elif c == 3:
aa.plot(kind="barh", x='name', width=1.0)
aa.xlabel='name of bird'
aa.ylabel='winter-2021'
plt.title("Bird Statistics Comparision in An Area over a Period of Time")
plt.show()
OUTPUT
15
4. Histogram
CODE:
elif c == 4:
aa.plot(kind="hist",x='winter-2021', bins=15, histtype="step")
aa.xlabel='name of bird'
aa.ylabel='winter-2021'
plt.title("Bird Statistics Comparision in An Area over a Period of Time")
plt.show()
OUTPUT
16
elif c == 5:
choice=d.main_menu()
OUTPUT:
17
READ
CODE:
OUTPUT:
18
DELETE ROW
CODE:
OUTPUT:
will
delete
this
entry
19
DELETE COLUMN
CODE:
OUTPUT:
20
ADD COLUMN
CODE:
New
Column
Added
OUTPUT:
21
VIEW COLUMN
CODE:
OUTPUT:
22
VIEW ROW
CODE:
elif choice == "viewR": # to view a single row nrow=int(input("Enter row no. to view: "))
nrow=int(input('Enter row number to view : '))
print(aa.loc[nrow])
break
OUTPUT:
23
APPEND
CODE:
elif choice == "append": # append a single row at the end of csv file
df = open("C:\\Users\\ritwi\\Desktop\\Grade 12\\IP Project\\Files\\csvfile.csv", 'a') #
opening file in append mode "a"
df.write("Thick-Knee, 5,4 \n")
df.close()
print(aa)
break
OUTPUT:
24
BIBLOGRAPHY
1. https://ebird.org/
2. https://www.wwfindia.org/
3. https://www.bnhs.org/
4. https://en.wikipedia.org/wiki/Bhigwan
5. www.geeksforgeeks.org