0% found this document useful (0 votes)
22 views29 pages

Naanal

The document outlines a project titled 'COVID ANALYSIS' for Grade XII Informatics Practices, focusing on managing COVID-19 data using Python and MySQL. It includes functionalities for data display, modification, and visualization, utilizing libraries such as Pandas and Matplotlib. The project also provides an overview of Python's features and history, along with hardware and software requirements for implementation.

Uploaded by

naanalpoovannan
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)
22 views29 pages

Naanal

The document outlines a project titled 'COVID ANALYSIS' for Grade XII Informatics Practices, focusing on managing COVID-19 data using Python and MySQL. It includes functionalities for data display, modification, and visualization, utilizing libraries such as Pandas and Matplotlib. The project also provides an overview of Python's features and history, along with hardware and software requirements for implementation.

Uploaded by

naanalpoovannan
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/ 29

INFORMATICS PRACTICES

TOPIC: COVID ANALYSIS

2024 - 2025
NAME​ ​ ​ ​ :

REG NO​ ​ ​ ​ :​

CLASS​ ​ ​ ​ :​ XII

TEACHER’S NAME​ ​ :​

SIGNATURE​ ​ ​ :​

DATE​ ​ ​ ​ :​

INTERNAL EXAMINER EXTERNAL EXAMINER PRINCIPAL


BONAFIDE CERTIFICATE

This is to certify that of Grade XII has prepared the report on the
project entitled “COVID ANALYSIS”. The report is the result of her
efforts and endeavours. The report is found worthy of acceptance as
final project report for the subject Informatics Practices of Grade XII.
She has prepared the report under my guidance.

Signature of Internal ​ ​ ​ Signature of External


Examiner ​ ​ ​ ​ Examiner

_________________ ​ ​ ​ __________________
​ ​
​ ​ ​ ​ Signature of Principal

________________
ACKNOWLEDGEMENT

Firstly, we would like to express special thanks to our teacher


Ms. S. Janani for guidance and support.

My sincere thanks to my Principal Ms. P. Padmavathy, for her


co-ordination in extending every possible support for the
completion of this project.

I also thank my parents for their motivation and encouraging me


during the course of this project.

I must thank my fellow classmate for her support in


development and completion of this project.

Finally, I would like to thank CBSE for giving me this opportunity


to undertake this project.
INDEX

CONTENTS PAGE NO

INTRODUCTION

OVERVIEW OF PYTHON

HISTORY OF PYTHON

PYTHON FEATURES

OVERVIEW OF MYSQL

HARDWARE AND SOFTWARE SPECIFICATION

SOURCE CODE

OUTPUT SCREEN SHOTS

BIBILOGRAPHY
INTRODUCTION:
This project is designed for managing COVID-19 data in a CSV file. The
program uses Pandas and Matplotlib for data manipulation and
visualization.
Here's an overview of the main functionalities:

✔​Data Display Functions:

​showData(): Reads the COVID-19 data from the "covid_19.csv"


file and displays it using Pandas.

​dataNoIndex(): Reads the data with the first column as the index.

​data_sorted(): Reads the data and displays it sorted based on the


'Confirmed' column.

✔​Data Modification Functions:

​write_data(): Allows the user to insert data for particular districts


(confirmed cases, recovered cases, deaths, active cases) and
appends it to the CSV file.

​edit_data(): Edits a specific record in the CSV file based on user


input.
​delete_data(): Deletes data for a specific district from the CSV
file.

✔​Data Visualization Functions:

​line_chart(): Provides a menu to plot line charts for various


COVID-19 data (confirmed, recovered, deaths, active) for
different districts.

​bar_chart(): Provides a menu to plot bar charts for various


COVID-19 data (confirmed, recovered, deaths, active) for
different districts.
It also includes an option for a combined bar chart.

✔​Main Menu Function:

​main_menu(): Displays the main menu with options to perform


different operations on the COVID-19 data.
OVEVIEW OF PYTHON:
Python is a high-level, interpreted, interactive and object-oriented scripting
language. Python is designed to be highly readable. It uses English
keywords frequently where as other languages use punctuation, and it has
fewer syntactical constructions than other languages.

●​ Python is Interpreted
o​ Python is processed at runtime by the interpreter. You do not
need to compile your program before executing it. This is
similar to PERL and PHP.
●​ Python is Interactive
o​ You can actually sit at a Python prompt and interact with the
interpreter directly to write your programs.
●​ Python is Object-Oriented
o​ Python supports Object-Oriented style or technique of
programming that encapsulates code within objects.
●​ Python is a Beginner's Language
o​ Python is a great language for the beginner-level programmers
and supports the development of a wide range of applications
from simple text processing to WWW browsers to games.
HISTORY OF PYTHON:
Python was developed by Guido van Rossum in the late eighties and early
nineties at the National Research Institute for Mathematics and Computer
Science in the Netherlands.

Python is derived from many other languages, including ABC, Modula-3,


C, C++, Algol-68, SmallTalk, and Unix shell and other scripting
languages.

Python is copyrighted. Like Perl, Python source code is now available


under the GNU General Public License (GPL).

Python is now maintained by a core development team at the institute,


although Guido van Rossum still holds a vital role in directing its progress.
PYTHON FEATURES:

●​ Easy-to-learn − Python has few keywords, simple structure, and a


clearly defined syntax. This allows the student to pick up the
language quickly.
●​ Easy-to-read − Python code is more clearly defined and visible to
the eyes.
●​ Easy-to-maintain − Python's source code is fairly easy-to-maintain.
●​ A broad standard library − Python's bulk of the library is very
portable and cross-platform compatible on UNIX, Windows, and
Macintosh.
●​ Interactive Mode − Python has support for an interactive mode
which allows interactive testing and debugging of snippets of code.
●​ Portable − Python can run on a wide variety of hardware platforms
and has the same interface on all platforms.
●​ Extendable − You can add low-level modules to the Python
interpreter. These modules enable programmers to add to or
customize their tools to be more efficient.
●​ Databases − Python provides interfaces to all major commercial
databases.
●​ GUI Programming − Python supports GUI applications that can be
created and ported to many system calls, libraries and windows
systems, such as Windows MFC, Macintosh, and the X Window
system of Unix.
●​ Scalable − Python provides a better structure and support for large
programs than shell scripting.

Apart from the above-mentioned features, Python has a big list of good
features, few are listed below −

●​ It supports functional and structured programming methods as well


as OOP.
●​ It can be used as a scripting language or can be compiled to
byte-code for building large applications.
●​ It provides very high-level dynamic data types and supports dynamic
type checking.
●​ It supports automatic garbage collection.
●​ It can be easily integrated with C, C++, COM, ActiveX, CORBA,
and Java.
OVERVIEW OF MYSQL:

A database system is basically a computer-based record keeping system.


The collection of data, usually referred to as the database, contains
information about one particular enterprise. In a typical file-processing
system, permanent records are stored in various file. A number of different
application program are written to extract records from files and add
records to the appropriate files A data management system is answer to all
these problem as it provides a centralized control of the data.

Various advantages of data base system are:

●​ Data base system reduce data redundancy (data duplication) to a


large extent.
●​ Data base system control data inconsistency to a large extent.
●​ Database facilitate sharing of data.
●​ Database enforces standards.
●​ Centralized data bases can ensure data security.
●​ Integrity can be maintained through databases.

My SQL is a freely available source Relational Database Management


System (RDMS) that uses Structured query language (SQL). It is
downloadable from site WWW.MYSQL.ORG. In a MYSQL database,
information stored in tables
HARDWARE AND SOFTWARE REQUIREMENTS:

I.​ OPERATING SYSTEM: WINDOWS 7 AND ABOVE


II.​ PROCESSOR: PENTIUM(ANY) OR Core i3, i5, i7
III.​ MOTHERBOARD: 2.30 GHz to 3.5 GHz
IV.​ RAM: 512MB+
V.​ Hard disk: SATA 40 GB OR ABOVE
VI.​ CD/DVD r/w multi drive combo: (If back up required)
VII.​ MONITOR 14.1 or 15 -17 inch
VIII.​ Key board and mouse
IX.​ Printer: (if print is required – [Hard copy])

SOFTWARE REQUIREMENTS:

I.​ Windows OS 7 or 10 or 11
II.​ Python 3.6 to 3.9
SOURCE CODE:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def showData():
​ df=pd.read_csv("covid_19.csv")
​ print(df)
​ input("Press any key to continue....")
def dataNoIndex():
​ df=pd.read_csv("covid_19.csv",index_col=0)
​ print(df)
​ input("Press any key to continue...")
def data_sorted():
​ df=pd.read_csv('covid_19.csv')
​ print(df.sort_values(by=['Confirmed']))
def write_data():
​ print("Insert data of particular districts in list form:")
​ di=eval(input("Enter Districts:"))
​ con_cases=eval(input("Enter no. of confirmed cases:"))
​ rec=eval(input("Enter no. of recovered cases:"))
​ deaths=eval(input("Enter deaths:"))
​ active=eval(input("Enter active cases:"))

d={'Districts':di,'Conirmed':con_cases,'Recovered':rec,'Deaths':deaths,'A
ctive':active}
​ df=pd.DataFrame(d) df.to_csv('covid_19.csv', mode='a',
index=False, header=False)
​ print("Data has been added.")
​ input("Press any key to continue...)
def edit_data():
​ df=pd.read_csv("covid_19.csv")
​ di=input("Enter district to edit:")
​ col=input("Enter column name to update:")
​ val=input("Enter new value")
​ df.loc[df[df['Districts']==di].index.values,col]=val
​ df.to_csv("covid_19.csv",index=False)
​ print("Record has been updated...")
​ input("Press any key to continue...")
def delete_data():
​ di=input("Enter district to delete data:") ​
​ df=pd.read_csv("covid_19.csv")
​ df=df[df.Districts!=di]
​ df.to_csv('covid_19.csv',index=False)
​ print("Record deleted...")
def line_chart():
​ df=pd.read_csv('covid_19.csv')
​ District=df["Districts"]
​ Confirmed=df["Confirmed"]
​ Recovered=df["Recovered"]
​ Deaths=df["Deaths"]
​ Active=df["Active"]
​ plt.xlabel("Districts")
Y=0
while Y!=6:
​ print(" ==============================")
​ print(" Line Graph Menu") print("
==============================")
​ print("1.District wise Conirmed Cases ")
​ print("2.District wise Recovered Cases ")
​ print("3.District wise Death Cases")
​ print("4.District wise Active Cases")
​ print("5.All data")
​ print("6.Return to main menu.")
Y = int(input("Enter your choice to get line graph: "))
if Y == 1:
​ plt.ylabel("Confirmed Cases")
​ plt.title("Districts Wise Confirmed Cases")
​ plt.plot(District, Confirmed, color='b')
​ plt.show()
elif Y == 2:
​ plt.ylabel("Recovered Cases")
​ plt.title("Districts Wise Recovered Cases")
​ plt.plot(District, Recovered, color='g')
​ plt.show()
elif Y == 3:
​ plt.ylabel("Death Cases")
​ plt.title("Districts Wise Death Cases")
​ plt.plot(District, Deaths, color='r')
​ plt.show()
elif Y == 4:
​ plt.ylabel("Active Cases")
​ plt.title("Districts Wise Active Cases")
​ plt.plot(District, Active, color='c')
​ plt.show()
elif Y == 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()
elif Y==6:
​ print("Line Graph Closed.....")
​ main_menu()
else:
​ print("Sorry!! Invalid Option! Try Again!!!")
main_menu()
def bar_chart():
​ df=pd.read_csv('covid_19.csv')
​ District=df["Districts"]
​ Confirmed=df["Conirmed"]
​ Recovered=df["Recovered"]
​ Deaths=df["Deaths"]
​ Active=df["Active"]
​ plt.xlabel("Districts")
​ print(" ==============================")
​ print(" Bar Graph Menu")
​ print(" ==============================")
​ print("1. District Wise Confirmed Cases")
​ print("2. District Wise Recovered Cases")
​ print("3. District Wise Death Cases")
​ print("4. District Wise Active Cases")
​ print("5. All data")
​ print("6. Combine Bar Graph")
​ print("7. Return to main menu.")
y=0
while Y!=5:
​ Y = int(input("Enter your choice to get bar graph: "))
​ if Y == 1:
​ ​ plt.ylabel("Confirmed Cases")
​ ​ plt.title("Districts Wise Confirmed Cases")
​ ​ plt.bar(District, Confirmed, color='b', width = 0.5)
​ ​ plt.show()
elif Y == 2:
​ plt.ylabel("Recovered Cases")
​ plt.title("Districts Wise Recovered Cases")
​ plt.bar(District, Recovered, color='g', width = 0.5)
​ plt.show()
elif Y == 3:
​ plt.ylabel("Death Cases")
​ plt.title("Districts Wise Death Cases")
​ plt.bar(District, Deaths, color='r', width = 0.5)
​ plt.show()
elif Y == 4:
​ plt.ylabel("Active Cases")
​ plt.title("Districts Wise Active Cases")
​ plt.bar(District, Active, color='c', width = 0.5)
​ plt.show()
elif Y == 5:
​ plt.bar(District, Confirmed, color='b', width = 0.5, label = "Districts
Wise ConfirmedCases")
​ plt.bar(District, Recovered, color='g', width = 0.5, label = "Districts
Wise RecoveredCases")
​ 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 Y == 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
RecoveredCases")
​ 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()
elif Y==7:
​ print("Bar Graph Closed.....")
​ main_menu()
else:
​ print("Sorry!! Invalid Option! Try Again!!!")
​ main_menu()
def main_menu():
​ ch=0 print(" ==============================")
​ print(" Main Menu")
​ print(" ==============================")
while ch!=9:
​ print(""" 1. Show DataFrame
​ ​ 2. Data without index
​ ​ 3. Data in Ascending order of Confirmed cases
​ ​ 4. Add district data into CSV
​ ​ 5. Edit a record
​ ​ 6. Delete a record
​ ​ 7. Line Graph
​ ​ 8. Bar Graph
​ ​ 9. Exit """)
ch=int(input("Enter your choice:"))
if ch==1:
​ showData()
elif ch==2:
​ dataNoIndex()
elif ch==4:
​ write_data()
elif ch==3:
​ data_sorted()
elif ch==5:
​ edit_data()
elif ch==6:
​ delete_data()
elif ch==7:
​ line_chart()
elif ch==8:
​ bar_chart()
elif ch==9:
​ print("Thank you for using our App, Bye Bye, See you again!!")
​ break
main_menu()
OUTPUT SCREEN SHOTS:
Data without Index
Data in ascending order of confirmed cases
Edit A Record
Delete A Record
Data Analysis using Line and Bar Graph
BIBLIOGRAPGHY:
1.​ Informatics Practices - Class XII
By: Sumita Arora
2.​ Websites:
i. Geeks for geeks python
ii. W3schools Python
iii. Learn Python.org
iv. Code Academy
v. Python Challenges.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy