IP Assigment Edited
IP Assigment Edited
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: ……………………………………….
Hardware Requirements:
Software:
1.Python IDLE 3.8
2.Microsoft Excel
Technology Used
Python:
Matplotlib:
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:
https://www.macrotrends.net/countries/IND/india/crime-rate-
statistics