0% found this document useful (0 votes)
5 views

Create a DataFrame with cer and ack

Uploaded by

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

Create a DataFrame with cer and ack

Uploaded by

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

Create a DataFrame

Question: Create a DataFrame with columns 'Name', 'Age', and 'City'.

Program:

Output:

Name Age City


0 Alice 24 New York
1 Bob 27 Los Angeles
2 Charlie 22 Chicago

Add a New Column

Question: Add a column 'Marks' to the DataFrame with values 85, 90, and 88.

Program:

Output:

Name Age City Marks

0 Alice 24 New York 85


1 Bob 27 Los Angeles 90
2 Charlie 22 Chicago 88

Delete a Column
Question: Delete the 'City' column from the DataFrame.

Program:

Output:

Name Age Marks


0 Alice 24 85
1 Bob 27 90
2 Charlie 22 88

Display DataFrame Info

Question: Display basic information about the DataFrame.

Program:

Output:

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 3 entries, 0 to 2
Data columns (total 3 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Name 3 non-null object
1 Age 3 non-null int64
2 Marks 3 non-null int64
dtypes: int64(2), object(1)
memory usage: 200.0+ bytes
None

Display Statistical Summary

Question: Display a statistical summary of the DataFrame.

Program:
Output:

Age Marks
count 3.000000 3.000000
mean 24.333333 87.666667
std 2.516611 2.516611
min 22.000000 85.000000
25% 23.000000 86.500000
50% 24.000000 88.000000
75% 25.500000 89.000000
max 27.000000 90.000000

Select a Column

Question: Select the 'Name' column from the DataFrame.

Program:

Output:

0 Alice
1 Bob
2 Charlie
Name: Name, dtype: object

Select Multiple Columns

Question: Select the 'Name' and 'Marks' columns from the DataFrame.

Program:

Output:

Name Marks
0 Alice 85
1 Bob 90
2 Charlie 88

Select Rows Based on Condition

Question: Select rows where 'Age' is greater than 23.


Program:

Output:

Name Age Marks


0 Alice 24 85
1 Bob 27 90

Sort DataFrame

Question: Sort the DataFrame by 'Marks' in descending order.

Program:

Output:

Name Age Marks


1 Bob 27 90
2 Charlie 22 88
0 Alice 24 85

Group by Column

Question: Group the DataFrame by 'Name' and calculate the mean of 'Marks'.

Program:

Output:

Name
Alice 85
Bob 90
Charlie 88
Name: Marks, dtype: int64
Merge Two DataFrames

Question: Merge two DataFrames on 'Name' column.

Program

Output:

Name Maths Science


0 Alice 85 89
1 Bob 92 94
Acknowledgment
I would like to express my sincere
gratitude to Mr. Nitin Wadhwa sir (my
Information Practices teacher) for his
invaluable guidance, support, and
encouragement throughout the course
of this project. His expertise and
insightful suggestions have been
instrumental in helping me develop a
better understanding of the concepts
involved in the Railway Reservation
System.
I also extend my thanks to my
classmates, friends, and family for their
continuous encouragement and
assistance.
Thank you to everyone who has
contributed in completion of this
project.
Acknowledgmen
t
I would like to express my sincere
gratitude to my Information Practices
teacher, Mr. Nitin Wadhwa sir, for his
constant guidance and support in helping
me understand complex topics like Pandas,
Matplotlib, and SQL queries. His expert
advice played a vital role in completing
this practical file successfully.
I also thank my school for providing the
necessary resources, and my classmates
and friends for their valuable suggestions
and encouragement throughout this
project.
Lastly, I am deeply grateful to my family
for their patience and support during the
course of this work.
CERTIFICATE
This is to certify that Shubham Sharma, a student of
Class 12th B, Roll No. 12233, has successfully
completed the project on "Railway Reservation
System" as part of the Information Practices
curriculum, under the guidance of Mr. Nitin Wadhwa.
The project is a comprehensive study and
implementation based on the concepts learned in the
subject and demonstrates a strong understanding of the
principles of data management and system
development.
The project has been prepared in accordance with the
guidelines provided by the CBSE and has been
submitted for evaluation.
We wish the student continued success in their future
academic endeavours. ]

Internal Examiner: External Examiner:

CERTIFICATE
This is to certify that Shubham Sharma, a student
of Class 12th B, Roll No. 12233, has successfully
completed the Practical File for the subject
Information Practices (IP), under the guidance of
Mr. Nitin Wadhwa. The practical file includes
programs based on various topics, demonstrating
the student's understanding and application of the
concepts covered in the curriculum.
The practical file has been prepared in accordance
with the guidelines provided by the CBSE and has
been submitted for evaluation.
We wish the student continued success in their
future academic endeavours

Internal Examiner: External Examiner:

You might also like