0% found this document useful (0 votes)
15 views16 pages

Project IP 2023

Uploaded by

hammad.desktop
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views16 pages

Project IP 2023

Uploaded by

hammad.desktop
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

K

VIDYA ANDIR,
JAWA
WAHAR

ARvIDY
A
SHYAMA,
AMAL
nANC

INFORMATICSPRACTICES PROJECT FILE


(2022-23)

NAME: TUSHARANSHU PANDEY


CLASS and SECTION: XII 'A'
ROLL NO: 2269 8814
REGISTRATIONNO.: 0442/2021
CERTIFICATE

This is to certify that the content of this project


entitled "Importing/Exporting Databetween CSV
Files and Pandas " is a bonafide work of,

TUSHARANSHU PANDEY' of Class XIl 'A", submitted


to "Mr. J. K.
JAISWAL" for consideration in partial
fulfilment of the CBSE's AISSCE Examination 2022-
23.

The original research work was carried out by him


under my supervision in the academic year 2022-23.
On the basis of the declaration made by him. I
recommend this project for evaluation

o93}3
Teacher In-Charge 1 1 2 3

Extemal Examinex
(Mr. J. K. JAISWAL)
ACKNOWLEDGEMENT

I would like to express my special thanks of


gratitude of my teacher Mr. Jayant Kumar Jaiswal
who gave me the golden opportunity to do this
wonderful project of Informatics Practices on
Importing/ExportingData between CSV Files and
Pandas who has helped me in completing my
project.I came to know so many new things andI
am really thankful to them.

Secondly, I would also like to thanks my parents and


friends who helped me a lot in finalizing my project.
TABLE OF CONTENT
1. Write a program that reads from a csv file ( marks.csv
stored in data folder of C: drive having data as shown
below: Name and marks in 3 subjects) in a dataframe.
Then, the program should add a column "Total"

storing total of marks in three subjects and another


column storing average marks. Print the dataframe
after adding these columns.

marks- Notepad
File Edit Format View Help
Atul, 65,67,76
Aditya,45, 34, 3
Sidhart,97,92, 88
Aryan, 66, 5 6 , 6 e
Bhanu, 85, 90,87

2.Consider the dataframe allDf as shown below:

Name Product Target Sales


ZoneA Purv Oven 56000.e 5800e.e

ZoneB Paschim AC 70000.0 68000.e

ZoneC Kendriya AC 75000.e 7800e.e


oven 60000.e 6100e.e
ZoneD Dakshin
Oven NaN NaN
ZoneE Uttar
Rural Tubewel1 NaN NaN
ZoneF

of this dataframe to a CSV file


Write a program to export the contents

A
3. Write a program to read from a CSV file Employee.csv
and create a dataframe from it.

4. Write a program to read from a CSV file Employee.csv


and create a dataframe from it but dataframe should not
use file's column header rather should use own column no.
0,1,2 and so on.

5. Write program to read from a CSV file Employee.csv


a

and create a dataframe from it dataframe should not use


file's column header rather should use own column
headings as EmplD, EmpName, Designation and Salary.
Also print the maximum salary given to an employee
ACTIVITY-01
Aim:
Write a program that reads from a csv file

(marks.csv stored in data folder of C: drive having

data as shown below: Name and marks in 3 subjects)

in a DataFrame. Then, the program should add a

column 'Total' storing total of marks in three

subjects and another column storing average marks.

Print the DataFrame after adding these columns.

marks - Notepad

File Edit Format View H e l p


Atul, 65,67,76
Aditya, 45,34, 30
Sidhart,97,92,88
Aryan, 66, 56, 6 e
Bhanu, 85, 90,87
INPUT:
import pandas as pd
f1 pd.read_csv("C:\\datallmarks.csv", names ["Nane", "Harksl", arks2, arks3"])
print("Datafrane after fetching data from CSV file")
orint(df1)
fA "Total"]: df1["Harks1"]. dfl[ "Marks2"]: df1[Wlarks3'] #"Totol" colu
f1 Average arks"] df1['Total']/3
orint("Detafrane after all calculations")
orint df1)

OUTPUT
Dataframe after fetching data from cSV file
Name Marks1 Marks2 Marks3
Atul 65 67 76
Aditya 45 34 30
Sidhart 97 92 88
Aryan 66 56 60
4 Bhanu 85 90 87
Datafrane after all calculations
Name Marks1 Marks2 Marks3 Total Average Marks
Atul 65 67 76 208 69.333333
1 Aditya 45 34 30 109 36.333333
Sidhart 97 92 88 277 92.333333
Aryan 66 56 60 182 60.666667
Bhanu 85 90 87 262 87.333333
ACTIVITY-02
Aim:
Consider the dataframeallDf as shown below:
Name Product Target Sales
ZoneA Purv oven 56000.0 58000.0
ZoneB Paschim AC 70000.e 68000.0
ZoneC Kendriya AC 75000.e 780ee.o
ZoneD Dakshin oven 60000.0 61000.0
ZoneE Uttar Oven NaN NaN
ZoneF Rural Tubewell1 NaN NaN

Write a program to export the contents of this


dataframe to a CSV file

Input:
import pandas as pd

#dataframe alLDf created


#writing to csv file
allDf.to_csv("C: \\pywork\\all.csv")
Output:
all-Notepad
File Edit Format View Help

, Name, Product, Target, Sales


ZoneA, Purv,oven, 56000.0, 58000.
ZoneB, Paschim, AC, 70000.e, 68000.0
ZoneC, Kendriya,AC, 75000.0,78000.0
ZoneD,Dakshin,oven,60000.0,61000.0
ZoneE,Uttar,Oven,
ZoneF, Rural, Tubewell, ,
ACTIVITY-03
Aim:
Write a program to read from a CSV file

Employee.csv and create a dataframe from it.

Employee - Notepad

File Edit Format View Help


Empno, Name, Designation, Salary
1001, Arun, Manager, 5600e
1002, Varun, Manager, 55900
1003, Sourav, Analyst, 350ee
1004, Aarav, Clerk, 25000
1005, Ruchi, PR Officer, 3100e

Input
import pandas as pd
df3- pd.read_csv("C: \\pywork\ \Employee . csv")
print (df3)
OUTPUT:

Empno Name Designation Salary


1001 Arun Manager 56000
1002 Varun Manager 55900
2 1003 Sourav Analyst 35000
3 1004 Aarav Clerk 33400
4 1005 Ruchi PR Office 43000
ACTIVITY-04
Aim:
Write a program to read from a CSV file

Employee.csv and create a dataframe from it but


dataframe should not use file's column header rather
should use own column no. 0,1,2 and so on.

Employee- Notepad
File Edit Format View Help

Empno, Name, Designation, Salary


1001, Arun, Manager, 5600e
1002, Varun, Manager, 55900
1003, Sourav, Analyst, 35000
1004, Aarav, Clerk, 25000
1005, Ruchi, PR Officer, 3100e
INPUT:

import pandas as pd
df4 pd.read_csv("C:\\pywork\\ Employee.csv", header None, skiprows=1)
print(df4)

OUTPUT:

1 2 3
1001 Arun Manager 56000
1 1002 Varun Manager 55900
1003 SouraV Analyst 3500e
33 1004 Aarav Clerk 33400
1005 Ruchi PR Office 43000
ACTIVITY-05

Aim:
CSV file
Write a program to read from a

create a dataframe from it


Employee.csv and
dataframe should not use file's column header rather

should use own column headings as EmplD,

the
EmpName, Designation and Salary. Also print
maximum salary given to an employee.

Employee - Notepad
File Edit Format View Help

Empno, Name, Designation, Salary


1001, Arun, Manager, 56000
1002, Varun, Manager, 55900
1003, Sourav, Analyst, 3500
1004, Aarav, Clerk, 25000
1005, Ruchi, PR Officer,3100e
INPUT:
import pandas as pd
dE5 pd.read csv("C: \\pywork \\Employee. csv.
names =[ "EmpID, "Emptiame", "Designation", "salary"1.
skiprows=1)
print(des)
print(ax imum salary is",df5.Salary. max())

OUTPUT:

Empno EmpName Designation Salary


1001 Arun
Manager 5600e
1002Varun Manager 55900
2 1003 Sourav Analyst 35000
3 1004 Aarav Clerk 33400
4 1005 Ruchi PR Office 43000
Maximum salary is 56000
VIll.

EMPNO
8698 ENAME SAL
8499 BINA 2850
8844 ANYA 160e
8521 KULDEEP 1500
8654 SETH 1250
8900 MONIN 1250
JATIN 956

Bibliography
Informatics practices, Class XII, by NCERT
Intormatics practices, by Sumita Aroraa
https://www.w3schools.com
http://www.tutorialspoint.com
>https://onecompiler.com/mysql

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy