You are on page 1of 30

Laurel high the school

A PROJECT REPORT
ON
Rape Victims Analysis

Submitted to submitted by:


Mrs.bhavna malik zinnia sharma
p.g.t.(comp. sc)

Index
oCertificate
oAcknowledgement
oHardware and software
requirements
oIntroduction
oSource Code
oOutputs
oBibliography

CERTIFICATE
This is to certify that zinnia sharma of class XII
A of LAUREL high the school has done her project
under my supervision. She has taken interest and has
shown at most sincerity in completion of this project.

I certify this Project up to my expectation & as per


guidelines issued by CBSE, NEW DELHI.

Internal Examiner External Examiner

ACKNOWLEDGMENT
It is with pleasure that I acknowledge my sincere
gratitude to our teacher, who taught and undertook the
responsibility of teaching the subject computer science.
I have been greatly benefited from his classes.
I am especially indebted to our Principal who has
always been a source of encouragement and support and
without whose inspiration this project would not have
been a successful I would like to place on record
heartfelt thanks to him.
Finally, I would like to express my sincere appreciation
for all the other students for my batch their friendship &
the fine times that we all shared together.

Hardware and Software Requirement


Front End:
Python 3.8.2
Back End:
CSV File
Operating System:
Windows 10
Minimum Hardware and Software Requirements:
Operating System:
x86 64-bit CPU (Intel / AMD architecture)
4 GB RAM.
5 GB free disk space.
Open Source Software being used:
1. Python 3.8.2
a. Pandas
b. Matplotlib

Rape Vicitim Analysis


Introduction
Rape is the fourth most common crime against women in India.
According to the 2019 annual report of the National Crime Records
Bureau (NCRB), 32033 rape cases were registered across the
country, or an average of 88 cases daily, slightly lower than 2018
when 91 cases were registered daily. Of these, 30,165 rapes were
committed by perpetrators known
to the victim (94.2 % of cases) a high number similar to 2018. The
share of victims who were minors or below 18 - the legal age of
consent - stood at 15.4%, down from 27.8% in 2018. On the other
hand, rapes by juveniles remained high in India with 3 minors being
arrested for rape, assault and attempted violence on women and girls
each day in 2019.
India has been characterised as one of the "countries with the lowest
per capita rates of rape". The government also classifies consensual
sex committed on the false promise of marriage as rape. The
willingness to report rapes have increased in recent years, after
several incidents received widespread media attention and triggered
local and nationwide public protests. This led the government to
reform its penal code for crimes of rape and sexual assault.
According to NCRB 2019 statistics, Rajasthan reported the highest
number of rapes among Indian states. Other states in the hindi
heartland region, across North India, such as Madhya Pradesh, Uttar
Pradesh, Haryana and Chhattisgarh, also have the highest incidence of
sexual violence against women. Among metropolitan cities,
the national capital of Delhi continued to have the highest
incidence of rape at 1253 cases in 2019, while Jaipur had the highest
rape rate (per 100,000 population).

The Rape Victims Analysis is basically a database-based


project done with the help of python language.
This project is very useful for analysing the different rape
victims n different state of India
The project consists of different graphs to analyse and to
represent the data which will help the users to draw a
comparison and have a glance of different groups.
The project will help the users to get the analysed information in
well structured format making it easier to understand.
FEATURES OF PROJECT

1. Free of technical errors.


2. Time saving.
3. Reduces manual work.
4. Data is easily analyzed through various methods. Ex: sort (),
group by, mean, median, mode etc.
5. Visualized data. Ex: Bar chart, Scatter chart, Histogram etc.
6. User friendly interface.
Python as Front-End
Python is a simple, open-source and object-oriented coding language.
It is one of the programming languages that are easy to learn as it is a
dynamic type, high-level, and interpreted coding language.
Python language supports a cross-platform operating system that is
used to build different applications that create a more convenient
environment for the users.
Data Visualization and Data Science:
Using extracted data and Python libraries like NumPy, Pandas, one
can study information that you have and can easily perform several
operations. For data visualization, there are different libraries like
Seaborn, Matplotlib all are used to plot graphs and charts. This is one
of the Python features that is used by the data scientists.
Conclusion: Python is one of the simple programming
languages that is used for a variety of applications.
PYTHON FEATURES
1. Python is compact and very easy to use object-oriented
language.
2. Python is an expressive language – fewer line of codes and
simpler syntax
3. It is an interpreted language not a compiled language
4. Python can run equally well on variety of platforms like
windows, LINUX/UNIX, etc.
5. Python language is freely available along with its source code
6. Python has evolved into a powerful, complete and useful
language over these years.
CSV as Back-End

CSV stands for Comma Separated Values. It is a popular way of


representing and storing tabular, column-oriented data in a
persistent storage.
It’s very simple and contains only text, separated by commas, or a
long text with strings and lines or some other definite character.
It helps files to be easily transferred and transformed into any other
format that you need. It is used When data has a strict tabular
structure or to transfer large database between programs.
CSV FEATURES

1. CSV is human readable and easy to edit manually


2. CSV is simple to implement and parse
3. CSV is processed by almost all existing applications
4. CSV provides a straightforward information schema
5. CSV is faster to handle
6. CSV is smaller in size
7. CSV is considered to be standard format
Comma Separated Values (C.S.V) File

Rape_vicitims.csv (Excel View):


CODING
import pandas as pd
import matplotlib.pyplot as plt

vic=pd.read_csv("d:\\Project\\Rape_vicitim.csv",index_col=0)
while(True):
print("Main Menu")
print("1. Data Accessing")
print("2. Data Manipulation")
print("3. Data Analysis")
print("4. Data Visualization")
print("5. Exit")
ch=int(input("Enter your choice"))
if ch==1:
while (True):
print("Data Accessing Menu")
print("1. Display Single Row")
print("2. Display specified State")
print("3. Display First n Rows")
print("4. Display Last n Rows")
print("5. To Display Selective state with selective Columns")
print("6. Exit")
ch2=int(input("Enter choice"))
if ch2==1:
row_no=int(input("Enter Row number to access"))
print(vic.iloc[row_no:row_no+1,])
elif ch2==2:
print(vic.index)
st_name=input("Enter State Name to access")
print(vic.loc[st_name,:])
elif ch2==3:
n=int(input("Enter Number of Rows ou Want to Access"))
print(vic.head(n))
elif ch2==4:
n=int(input("Enter Number of Rows ou Want to Access"))
print(vic.tail(n))
elif ch2==5:
print("Row Index=",vic.index)
print("Name of columns are:\n",vic.columns,"\n")
st_name1=input("Enter State Name 1 to access")
st_name2=input("Enter State Name 2 to access")
col_nm1=input("Enter Column Name 1")
col_nm2=input("Enter Column Name 2")
print(vic.loc[st_name1:st_name2,col_nm1:col_nm2])
elif ch2==6:
break
elif ch==2:
while(True):
print("Data Manipulation Menu")
print("1. Insert a state Record")
print("2. Delete a specific state Record")
print("3. Update a specific state Record")
print("4. Delete a specific column")
print("5. Exit")
ch3=int(input("Enter choice"))
if ch3==1:
st_nm=input("Enter state name")
year=int(input("Enter the year"))
cs_rep=int(input("Enter number of case reported"))
y10=int(input("Enter number of cases upto 10"))
y10_14=int(input("Enter number of cases between 10-14 yrs"))
y14_18=int(input("Enter number of cases between 14-18 yrs"))
y18_30=int(input("Enter number of cases between 18-30 yrs"))
y30_50=int(input("Enter number of cases between 30-50 yrs"))
y50=int(input("Enter number of cases above 50 yrs"))
total=y10+y10_14+y14_18+y18_30+y30_50+y50
vic.loc[st_nm]=[year,cs_rep,y10,y10_14,y14_18,y18_30,y30_50,y50,total]
print("Data successfully inserted")
print(vic.loc[st_nm,:])

elif ch3==2:
st_nm=input("Enter state name whose data needs to be deleted")
vic.drop([a],inplace=True)
print("Data successfully deleted")

elif ch3==3:
print(vic.columns)
print()
col1 = input('Enter column name :')
st_nm= input('Enter the index number of row:')
print()
new_col1 = input('Enter the new value:')
if type(new_col1) == int:
new_col1 = int(new_col1)
n =vic.at[st_nm,col1] = new_col1
else:
n = c.at[st_nm,col1] = new_col1
print(n)
print(vic)
print('COLUMN UPDATED')
print("Data successfully updated")
elif ch3==4:
print("Name of Columns are:\n",vic.columns)
col_nm=input("Enter column name which needs to be deleted")
vic.drop([col_nm],axis=1,inplace=False)
print("Column Temporary deleted")
elif ch3==5:
break
elif ch==3:
while(True):
print("Data Manipulation Menu")
print("1. Maximum Victims")
print("2. Minimum Victims")
print("3. Average Total Vicitems of Particular State")
print("4. Median of Total Vicitems of Particular State")
print("5. Exit")
ch4=int(input("Enter choice"))
if ch4==1:
print(vic.index)
st=input("Which state")
df=pd.DataFrame(vic[st:st])
print("aximum Rape Victims of",st," = ",df['Total Victims'].max())
elif ch4==2:
print(vic.index)
st=input("Which state")
df=pd.DataFrame(vic[st:st])
print("Minimum Rape Victims of",st," = ",df['Total Victims'].min())
elif ch4==3:
print(vic.index)
st=input("Which state")
df=pd.DataFrame(vic[st:st])
print("Average of Total Rape Victims of",st,"are = ",df['Total Victims'].mean())
elif ch4==4:
print(vic.index)
st=input("Which state")
df=pd.DataFrame(vic[st:st])
print("Median of Total Victims of",st," are = ",df['Total Victims'].median())
elif ch4==5:
break
elif ch==4:
while(True):
print("Data Visualization Menu")
print("1. Line Plot")
print("2. Vertical Bar Plot")
print("3. Horizontal Bar Graph")
print("4. Exit")
ch5=int(input("Enter choice"))
if ch5==1:
st=input("Which state you want to plot?")
n=int(input("How many Years"))
df=pd.DataFrame(vic[st:st].head(n))
yr=df['YEAR'].head(n)
y10=df['Victims upto 10 years']
y10_14=df['Victims 10-14 years']
y14_18=df['Victims 14-18 years']
y18_30=df['Victims 18-30 years']
y30_50=df['Victims 30-50 years']
y50=df['Victims above 50 years']
plt.plot(yr,y10,label="Vicitims upto 10 years", markersize=2 , linestyle='solid',
markeredgecolor='k')
plt.plot(yr,y10_14,label="Vicitims 10-14 years",markersize=2,linestyle='solid',
markeredgecolor='k')
plt.plot(yr,y14_18,label="Vicitims 14-18 years",markersize=2,linestyle='solid',
markeredgecolor='k')
plt.plot(yr,y18_30,label="Vicitims 18-30 years",markersize=2,linestyle='solid',
markeredgecolor='k')
plt.plot(yr,y30_50,label="Vicitims 30_50 years",markersize=2,linestyle='solid',
markeredgecolor='k')
plt.plot(yr,y50,label="Vicitims above 50
years",markersize=2,linestyle='solid', markeredgecolor='k')
plt.title("Line Graph representing Agewise Rape Vicitims")
plt.xlabel("Year")
plt.ylabel("Number of Vicitims")
plt.xticks(rotation=30)
plt.legend()
plt.grid(True)
plt.show()
elif ch5==2:
n=int(input("How many rowsfrom the top you want to plot?"))
df=vic.loc[:,['Cases Reported','Total Victims']].head(n)
df.plot(kind="bar")
plt.title("Horizontal Bar Graph representing statewise Rape Cases")
plt.xlabel("STATES")
plt.ylabel("Number of cases")
plt.show()
elif ch5==3:
n=int(input("How many states from the top you want to plot?"))
df=vic.loc[:,['Cases Reported','Total Victims']].head(n)
df.plot(kind="barh")
plt.title("Horizontal Bar Graph representing statewise Rape
Cases") plt.xlabel("Number of cases")
plt.ylabel("STATES")
plt.show()
elif ch5==4:
break
elif ch==5:
break
OUTPUTS
Main Menu and Data Acess Menu
Data Manipulation Menu
Data Analysis Menu
Data Visualisation Menu
BIBLIOGRAPHY
1. Informatics Practices- Sumita Arora
2.Informatics Practices- Preeti Arora
3.Kaggle.com for Data

You might also like