0% found this document useful (0 votes)
486 views20 pages

IP Assigment Edited

The document is a project report on analyzing crime rate data in India over the past 10 years. It describes using Python, Pandas, CSV files and data visualization libraries like matplotlib to analyze crime rate data stored in a CSV file. Tables, line charts, bar graphs and histograms are used to visualize trends in crime rate per 100,000 population from 2011 to 2021. The report outlines the technologies used and includes code samples and outputs for reading/writing CSV data, creating data frames, and generating various visualizations of the crime rate data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
486 views20 pages

IP Assigment Edited

The document is a project report on analyzing crime rate data in India over the past 10 years. It describes using Python, Pandas, CSV files and data visualization libraries like matplotlib to analyze crime rate data stored in a CSV file. Tables, line charts, bar graphs and histograms are used to visualize trends in crime rate per 100,000 population from 2011 to 2021. The report outlines the technologies used and includes code samples and outputs for reading/writing CSV data, creating data frames, and generating various visualizations of the crime rate data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 20

VIKAS The Concept School

Off Miyapur, Bachupally, Hyderabad-500090


Phones-7702900900, 9247799844

INFORMATICS PRACTICES
PROJECT
XII
Prepared by
Y. Chandramukhi Sekhar
VIKAS The Concept School
Off Miyapur, Bachupally, Hyderabad-500090
Phones-7702900900, 9247799844
INFORMATICS PRACTICES
PROJECT
REPORT
2023-2024
Name: ……………………….................
Class: ………………………………………
Reg.no: ……………………………………….

External Examiner Internal


Examiner
VIKAS The Concept School
Off Miyapur, Bachupally, Hyderabad-500090
Phones-7702900900, 9247799844
DEPARTMENT OF COMPUTER
SCIENCE
CERTIFICATE
This is to certify that this is the bonafide record
of
project work done in
…………………………………………………Laboratory
during
the academic year 2023-2024 by
Mr/Ms…………………………………………… of class XII
with registration No……………………

EXTERNAL EXAMINER INTERNAL


EXAMINER
ACKNOWLEDGEMENT
It is with great pleasure that I find myself penning
down
these lines to express my sincere thanks to various
people helped me a long way in completing this
project.
The harmonious climate in our school provided a
proper
guide for preparing the project. It was a privilege to
have
been guided by Ms. P. Dhanya Bargavi.
I would also like to extend my gratitude to all my
faculty
for helping me to complete my project successfully.
Thanks to all my classmates who helped me during
the
development of this project with their constructive
criticism and advice.
Name of the
Student
CONTENTS

S.No. Topic Topic Page


Number
1. Abstract 6
2. System 7
Requirements
3. Technology 8-12
Used
a) Python
b) Pandas
c) Data Frames
d) CSV File
e) Data
Visualization
and matplotlib
4. About The 13
Project
5. Coding And 14-18
Implementation,
Data
Visualization
6 Bibliography 19
Abstract

This project is titled 'Crime rate in India for the past 10


years' and is designed using python programming.
Its goal is to give the Effect on Indian crime rate shown in
forms of tables, line charts, Bar graphs and Horizontal bar
graphs.

This is a simple python-based analysis which is very easily


understandable
SYSTEM REQUIREMENTS

Hardware Requirements:

Software:
1.Python IDLE 3.8
2.Microsoft Excel
Technology Used

 Python:

 Python programming language was developed by Guido


Van Rossum in February 1991.
 Python is an easy-to-learn yet powerful object-oriented
programming language.
 It is a very high-level programming language yet as
powerful as many other middle-level not so high-level
languages like C, C++, Java etc.
 Pandas:

 Pandas is the most popular library in the scientific


Python Ecosystem for doing data analysis.
 Pandas is capable of many tasks like it can read or write in
many different data formats (integer, float, double etc)
 It can calculate in all the possible ways data is organised
i.e.,across rows and down columns.
 It can easily select subsets of data from bulky data sets and
even combine multiple datasets together.
 It has functionality to find and fill missing data.
 It allows you to apply operations to independent groups
within the data.
 It supports reshaping of data into different forms.
 It supports advanced time-series functionality
(Time series forecasting is the use of a model to predict
future values based on previously observed values).
 It supports visualization by integrating matplotlib and
seaborn etc libraries.
 DataFrame:

 A DataFrame is a Pandas structure, which stores data in


two-dimensional way.
 It is a two-dimensional (tubular and spreadsheet like)
labelled array, which is an ordered collection of columns
may store different types of data, example,
Major characteristics of a DataFrame are:
It has two indexes, or we can say that two axes- a row
indexes (axis=0) and a column index (axis=1).
 Conceptually it is like a spreadsheet where each value
is identifiable with the combination of row index and
column index.
 The row index is known as index in general and the column
index is called the column name.
 The indexes can be of numbers, letters, or strings.
 There is no condition of having all data of same type across
columns; its columns can have data of different types.
 DataFrames are value-mutable (its values can be easily
changed)
 DataFrames are size-mutable (rows/columns can be easily
added or deleted)
CSV File:

 Refers to the tabular data saved as plain text where data


values are separated by commas. The CSV format is
popular as it offers following advantages:
o A simple, compact, and ubiquitous format for
data storage.
 A common format for data interchange.
 It can be opened in popular spreadsheet packages like MS
Excel, Calc etc.
 Nearly all spreadsheets and databases support
import/export to csv format
 Python’s Pandas Library offers two functions read_csv ()
and to_csv () that help you bring data from a CSV File into
a DataFrame and write a DataFrame’s data to a CSV
Data Visualization:

 Data Visualization basically refers to the graphical and


visual representation of information and data using visual
elements like charts, graphs, and maps etc.
 Data Visualization is immensely useful in decision making
unveils patterns, trends, outliners, correlation etc. in the
data helping decision-makers understand the meaning of data
to drive decisions.

Matplotlib:

 The matplotlib is a Python Library that provides


many interfaces and functionalities for 2D graphics.
 Matplotlib is a high-quality plotting library of Python that
Provides both very quick way to visualize data from Python
and publication-quality figures in many formats.
 The matplotlib library offers many different names
collections of methods; PyPlot is one such interfaces, a
collection of methods within matplotlib which allows to
construct 2D plots easily and interactively.
ABOUT THE PROJECT

This project is titled 'Crime rate in India for the past 10


years' and is designed using python programming.
Its goal is to give the Effect on Indian crime rate shown in
forms of tables, line charts, Bar graphs and Horizontal bar
graphs.
This is a simple python-based analysis which is very easily
understandable
CODING AND IMPLEMENTATION

DATA FRAME DESIGN:

SOURCE CODE:
import pandas as pd
d1={'year':[2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021],\
'per 100K population':[3.79,3.73,3.55,3.62,3.35,3.16,3.03,2.99,2.93,2.91,2.94]}
df=pd.DataFrame(data=d1)
print(df)

OUTPUT
DATA FRAME TO CSV:

import pandas as pd
d1={'year':
[2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2
021],\
'per 100K population':
[3.79,3.73,3.55,3.62,3.35,3.16,3.03,2.99,2.93,2.91,2.94]}
df=pd.read_csv('C://Users//Sumarchan//Desktop//
crime_rate_in_india.csv')
print(df)

OUTPUT
CSV TO DATAFRAME:

import pandas as pd
d1={'year':
[2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2
021],\
'per 100K population':
[3.79,3.73,3.55,3.62,3.35,3.16,3.03,2.99,2.93,2.91,2.94]}
df=pd.DataFrame(d1)
df.to_csv('C://Users//Sumarchan//Desktop//df_to_csv.csv')
print(df)

OUTPUT:
DATA VISUALISATION:
LINE CHART:
SOURCE CODE:

import matplotlib.pyplot as p
crimerate=[3.79,3.73,3.55,3.62,3.35,3.26,3.03,2.99,2.93,2.91,2.94]
year=[2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021]
p.plot(year,crimerate,color='yellow',linewidth=4,marker='.',markeredgecolor='red',markersize=10,label=
'India')
p.title('crime rate in India for the past 10 years ')
p.legend()
p.xlabel('crime rate per 100K population')
p.ylabel('crime rate for the past 10 years')
p.show()

OUTPUT:
BAR GRAPH
SOURCE CODE:

import matplotlib.pyplot as p
crimerate=[3.79,3.73,3.55,3.62,3.35,3.26,3.03,2.99,2.93,2.91,2.94]
year=[2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021]
p.bar(year,crimerate,color='yellow',width=0.5,label='India')
p.title('crime rate in India for the past 10 years ')
p.legend()
p.xlabel('crime rate per 100K population')
p.ylabel('crime rate for the past 10 years')
p.show()

OUTPUT:
HISTOGRAM
SOURCE CODE:

import matplotlib.pyplot as p
crimerate=[3.79,3.73,3.55,3.62,3.35,3.26,3.03,2.99,2.93,2.91,2.94]
year=[2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021]
p.barh(year,crimerate,color='yellow',label='India')
p.title('crime rate in India for the past 10 years ')
p.legend()
p.xlabel('crime rate per 100K population')
p.ylabel('crime rate for the past 10 years')
p.show()

Output:
Bibliography:

Informatics Practices Class XI and class XII

https://www.macrotrends.net/countries/IND/india/crime-rate-
statistics

You might also like