Professional Documents
Culture Documents
INFORMATIC Complete Project
INFORMATIC Complete Project
PRACTICES
PROJECT
(BATCH 2023-24)
CLASS-12 A
NAME- LAKSHYA PRATAP
ROLL NO.-
K.L.K Saraswati Bal Mandir
Certificate
This is to certify that Lakshya Pratap of
Class 12 A has Successfully completed
the project under the guidance and
observation of Mr. Pankaj sir During the
academic session 2023-2024, in partial
fulfillment of practical examination
conducted by
Signature of teacher -
Signature of the principal-
Signature of examiner-
Acknowledgement
I would like to express my special thanks to my
Informatics Practices Teacher Mr. Pankaj Malik for
his able guidance and support in completing this
project.
2. Acknowledgement
3. Introduction to Pandas
5. Code
6. Output
7. Bibliography
INTRODUCTION TO PANDAS
What is Pandas?
Pandas is a Python library used for working with data sets.
Pandas are also able to delete rows that are not relevant,
or contains wrong values, like empty or NULL values. This
is called cleaning the data.
Where is the Pandas Codebase?
The source code for Pandas is located at this
GitHubrepository https://github.com/pandas-
dev/pandas
CSV files contains plain text and is a well know format that can be
read by everyone including Pandas.
EXAMPLE:
Steps to Import a CSV File into Python using
Pandas
Step 1: Capture the File Path
Firstly, capture the full path where the CSV file is stored.
For example, let’s suppose that a CSV file is stored under the
following path:
C:\Users\Ron\Desktop\my_products.csv
You’ll need to modify the Python code below to reflect the path where the
CSV file is stored on your computer. Don’t forget to include the:
File name (IN BOLD LETTERS). You may choose a different file name,
but make sure that the file name specified in the code matches with
the actual file name
File extension. The file extension should be “.csv” when
importing CSV files.
import pandas as pd
df =
pd.read_csv(r"C:\Users\Ron\Desktop\my_products.csv")
print(df)
Note- that you should place “r” before the path string to address any
special characters in the path, such as “\”. Additionally, don’t forget to put
the file name at the end of the path + “.csv”.
Step 3: Run the Code
Finally, run the Python code and you’ll get:
product brand price
0 Computer A 1200
1 Tablet B 350
2 Printer C 120
3 Monitor D 400
4 Keyboard E 80
The database (csv file) that is imported by using read_csv function of panda’slibrary
for completing this project:
CODING OF THE PROGRAM
import pandas as pd
d=pd.read_csv('C:\\Users\\DELL\\Music\\Share of
Students from Abroad.csv',encoding='ISO-8859-1')
print(' Login
')
u=input('Enter user name ')
p=input('Enter your password ')
if u=='Lakshya' and p=='1234':
print('welcome to our world!! ')
print('1.Display the dataframe ')
print('2.Add a new column ')
print('3.Add a new row ')
print('4.Delete a column ')
print('5.Plot a graph')
print('6.Delete a row ')
print('7.Rename a column ')
print('8.Rename a row ')
print('9.Update value column ')
print('10.Exit')
while True:
a=int(input('Enter a number '))
if a==1:
print(d.head())
elif a==2:
x=input('enter column name ')
c=int(input("Number of values "))
l1=[]
for i in range(1,c+1):
b=input(" Value You Want To Enter ")
l1.append(b)
print(l1)
d[x]=l1
print(d)
elif a==3:
x=input('enter row name ')
ac=int(input("Number of values "))
l1=[]
for i in range(1,ac+1):
bc=input(" Value You Want To Enter ")
l1.append(bc)
print(l1)
d.loc[x]=l1
print(d)
elif a==4:
ab=input('Enter Column Name ')
del d[ab]
print(d)
elif a==5:
print('1.Plot a Line graph')
print('2.Plot a Bar graph')
print('3.Plot a Histogram')
b=int(input('Enter The Graph Type '))
if b==1:
import matplotlib.pyplot as plt
xb=input('Column Name For X Axis ')
ad=input("Column Name For Y Axis ")
plt.plot(d[xb],d[ad])
plt.show()
elif b==2:
import matplotlib.pyplot as plt
xb=input('Column Name For X Axis ')
ad=input("Column Name For Y Axis ")
plt.bar(d[xb],d[ad])
plt.show()
elif b==3:
import matplotlib.pyplot as plt
xb=input('Column Name ')
plt.hist(d[xb])
plt.show()
elif a==6:
ae=int(input('Enter row name '))
d.drop(ae,axis=0,inplace=True)
print(d)
elif a==7:
af=input('Enter column name ')
ag=input('Enter new column name ')
d.rename({af:ag},axis='columns',inplace=True)
print(d)
elif a==8:
af=int(input('Enter row name '))
ag=input('Enter new row name')
d.rename({af:ag},axis='index',inplace=True)
print(d)
elif a==9:
ab=input('Enter column name ')
af=int(input('Enter row name '))
ac=int(input(" value "))
d.at[af,ab]=ac
print(d)
elif a==10:
print("Thank you")
exit()
break
else :
print('You are invalid user try again!! ')
CODES OUTPUT
1.Login
2.Show Dataframe
3. Add New Column
4.Add New Row
5.Delete A Column
6.Plot Graph
Type 3
Type 1
Type 2
6.Delete Row
2. https://www.w3schools.com/python/pandas/pandas_intro.asp
3. https://ncert.nic.in/textbook/pdf/leip1ps.pdf
4. https://www.selfstudys.com/books/ncert-
books/english/12th/informatics-practices/25446