Professional Documents
Culture Documents
A PROJECT REPORT
ON
Rape Victims Analysis
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.
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.
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