Computer Science Ip
Computer Science Ip
1|Page
BONAFIDE CERTIFICATE
Puducherry on _________.
2|Page
ACKNOWLEDGEMENT
Apart from the efforts for me, the success of my project depends largely on
the encouragement and guidelines of many others. I take this opportunity to
express my gratitude to the people who have been instrumental in the successful
completion of this project.
I express deep sense of gratitude to almighty God for giving me strength for
the successful completion of the project.
The guidance and support received from all the members who contributed
and who are contributing to this project, was vital for the success of the project. I
am grateful for their constant support and help.
3|Page
Content
Introduction
Requirement Analysis
System Specification
Source Code
Output
Bibliography
4|Page
Introduction
This project is all about the collection of data and interlinking the python with the
file in the computer system this source code and the programme allows the user to
read the data about COVID 19 and represent those data in various other forms such
as bar graph point graph line graph historic graph and etc. This court also creates
the graph for the data of COVID 19 with respect to different states districts and
region accordingly. This is very useful for comparing The datas of two different
regions together.
5|Page
About the Project
Panda is a Python library for data analysis. Started by Wes McKinney in 2008 out
of a need for a powerful and flexible quantitative analysis tool, pandas have grown
operations. Pandas acts as a wrapper over these libraries, allowing you to access
many of matplotlib's and NumPy's methods with less code. NumPy is a Python
library used for working with arrays.It also has functions for working in domain of
Travis Oliphant. It is an open source project and you can use it freely.NumPy
make matplotlib work like MATLAB. Each pyplot function makes some change to
a figure: e.g., creates a figure, creates a plotting area in a figure, plots some lines in
6|Page
System Specification
Hardware Requirements:
At least 2 GB RAM.
Software Requirements:
7|Page
Source Code
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def Fun():
print(":)")
print("#1. For checking the data.")
print("#2. Reading complete file without index.")
print("===================")
print("Topic - Data Visualization")
print(" ")
print("#3. Line Chart")
print(" Press 1 to print the data for Confirmed cases as per Districts.")
print(" Press 2 to print the data for Recovered cases as per Districts.")
print(" Press 3 to print the data for Death cases as per Districts.")
print(" Press 4 to print the data for Active cases as per Districts.")
print(" Press 5 to print All data.")
print(" ")
print("#4. Bar Graph")
print(" Press 1 to print the data for Confirmed cases as per Districts.")
print(" Press 2 to print the data for Recovered cases as per Districts.")
print(" Press 3 to print the data for Death cases as per Districts.")
print(" Press 4 to print the data for Active cases as per Districts.")
8|Page
print(" Press 5 to print the data in the form of a stack bar chart.")
print(" Press 6 to print the data in the form of a multi-bar chart.")
print(" ")
print("#5. Scatter Chart")
print(" ")
print("#6. For Exit")
print("===============")
def Read_CSV():
print("The Data")
df = pd.read_csv('D:\\Covid_data_kerala.csv')
print(df)
def No_Index():
print("Reading the file without index")
df = pd.read_csv('D:\\Covid_data_kerala.csv', index_col=0)
print(df)
def line_plot():
df = pd.read_csv('D:\\Covid_data_kerala.csv')
df['Districts'] =
['EKM','PTA','KTM','TSR','KKD','MPM','KLM','PKD','ALP','KNR','TVM
','IDK','WYD','KGD']
District = df["Districts"]
Confirmed = df["Confirmed"]
9|Page
Recovered = df["Recovered"]
Deaths = df["Deaths"]
Active = df["Active"]
plt.xlabel("Districts")
YC = int(input("Enter the number representing your preferred line chart
from the above choices: "))
if YC == 1:
plt.ylabel("Confirmed Cases")
plt.title("Districts Wise Confirmed Cases")
plt.plot(District, Confirmed, color='b')
plt.show()
elif YC == 2:
plt.ylabel("Recovered Cases")
plt.title("Districts Wise Recovered Cases")
plt.plot(District, Recovered, color='g')
plt.show()
elif YC == 3:
plt.ylabel("Death Cases")
plt.title("Districts Wise Death Cases")
plt.plot(District, Deaths, color='r')
plt.show()
elif YC == 4:
plt.ylabel("Active Cases")
plt.title("Districts Wise Active Cases")
plt.plot(District, Active, color='c')
10 | P a g e
plt.show()
elif YC == 5:
plt.ylabel("Number of cases")
plt.plot(District, Confirmed, color='b', label="Districts Wise Confirmed
Cases")
plt.plot(District, Recovered, color='g', label="Districts Wise Recovered
Cases")
plt.plot(District, Deaths, color='r', label="Districts Wise Death Cases")
plt.plot(District, Active, color='c', label="Districts Wise Active Cases")
plt.legend()
plt.show()
else:
print("Enter valid input")
def bar_plot():
df = pd.read_csv('D:\\Covid_data_kerala.csv')
df['Districts'] =
['EKM','PTA','KTM','TSR','KKD','MPM','KLM','PKD','ALP','KNR','TVM
','IDK','WYD','KGD']
District = df["Districts"]
Confirmed = df["Confirmed"]
Recovered = df["Recovered"]
Deaths = df["Deaths"]
Active = df["Active"]
plt.xlabel("Districts")
YC = int(input("Enter the number representing your preferred bar graph
from the above choices: "))
11 | P a g e
if YC == 1:
plt.ylabel("Confirmed Cases")
plt.title("Districts Wise Confirmed Cases")
plt.bar(District, Confirmed, color='b', width=0.5)
plt.show()
elif YC == 2:
plt.ylabel("Recovered Cases")
plt.title("Districts Wise Recovered Cases")
plt.bar(District, Recovered, color='g', width=0.5)
plt.show()
elif YC == 3:
plt.ylabel("Death Cases")
plt.title("Districts Wise Death Cases")
plt.bar(District, Deaths, color='r', width=0.5)
plt.show()
elif YC == 4:
plt.ylabel("Active Cases")
plt.title("Districts Wise Active Cases")
plt.bar(District, Active, color='c', width=0.5)
plt.show()
elif YC == 5:
plt.bar(District, Confirmed, color='b', width=0.5, label="Districts Wise
Confirmed Cases")
plt.bar(District, Recovered, color='g', width=0.5, label="Districts Wise
Recovered Cases")
12 | P a g e
plt.bar(District, Deaths, color='r', width=0.5, label="Districts Wise Death
Cases")
plt.bar(District, Active, color='c', width=0.5, label="Districts Wise Active
Cases")
plt.legend()
plt.show()
elif YC == 6:
D = np.arange(len(District))
width = 0.25
plt.bar(D, Confirmed, width, color='b', label="Districts Wise Confirmed
Cases")
plt.bar(D + 0.25, Recovered, width, color='g', label="Districts Wise
Recovered Cases")
plt.bar(D + 0.50, Deaths, width, color='r', label="Districts Wise Death
Cases")
plt.bar(D + 0.75, Active, width, color='c', label="Districts Wise Active
Cases")
plt.legend()
plt.show()
else:
print("Enter valid input")
def scatter_chart():
df = pd.read_csv('D:\\Covid_data_kerala.csv')
df['Districts'] =
['EKM','PTA','KTM','TSR','KKD','MPM','KLM','PKD','ALP','KNR','TVM
','IDK','WYD','KGD']
District = df["Districts"]
13 | P a g e
Confirmed = df["Confirmed"]
Recovered = df["Recovered"]
Deaths = df["Deaths"]
Active = df["Active"]
SC = plt
Output
14 | P a g e
Bibliography
Python Documentation:
https://docs.python.org/3/ws
Schools:
https://www.w3schools.com/python/
www.matplobib.com
15 | P a g e
www.numpi.com
16 | P a g e