Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
17 views
02 Practical 002
Uploaded by
Pawan Raut
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save 02_practical_002 For Later
Download
Save
Save 02_practical_002 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
17 views
02 Practical 002
Uploaded by
Pawan Raut
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save 02_practical_002 For Later
Carousel Previous
Carousel Next
Save
Save 02_practical_002 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 3
Search
Fullscreen
GQ In Practical 2: Exploring Pandas Data Structures Aim: Understand the Pandas library and its primary data structures. Theory: Pandas is @ popular Python library for data manipulation and analysis. Itprovides two primary data structures: Series and DataFrame. Series: A one-dimensional labeled array capable of hélding any data type. It is similar to a NumPy array but with labeled indices, making data alignmentland indexing more: convenient. DataFrame: A two-dimensional labeled data structure withicolumns of potentially different data types. Its like a spreadsheet or SQL table, where data can be easily manipulated and analyzed. Some important concepts to undlerstand in Pandas are: Creating Series and DataFrame: Creating Series using pd.Series() and DataFrame using pd.DataFrame(). Data Exploration: Aétessing rows, columns, and specific data from a DataFrame. Data Cleaning: Handling missing data, duplicate data, and performing data transformations. DatalVisualization,Basic visualization Using Pandas built-in plotting capabilites. Example Programsialong with concepts: 1. Creating Series and DataFrame: import pandas as pd # Creatmipa Series series_data = pd.Series([1e, 20, 30, 49, 5@]) print (Series data) @ 10 1 20 2 30 3 40 4 50 dtype: intes # Creating a DataFrane data = {‘Name’: ['Alice*, "Bob", ‘Charlie’, ‘David"], *Age': [25, 30, 35, 40], City's ['New York", ‘London*, ‘Paris’, ‘Tokyo"]} df = pd.DataFrane(data) print (oF)In [4] In [5] In [6] In, In [8] Name Age city @ Alice 25 New York 1 Bob 3@ London 2 Charlie 35 Paris 3 David 4 © — Tokyo 2. Data Exploration: import pandas as pd # Accessing columns print (d#[ ‘Name’ }) @ Alice 1 Bob 2 Charlie 3 David Name: Name, dtype: object # Accessing rows using iloc (integer-based indexing) print (éf.i1oc[1}) Name Bob Age 30 London 1, dtype: object # Accessing rows using loc (Label-based indexing) pein) some ah a Cy nae rs fon 2) # Accessing specific print(df.at(1, 'Name'] Bob ata Cleaning: # Removing duplicates df with duplicates = pd.Dataframe({'A": [1, 2, 2, 3, 3]})) df_deduplicated = df_with_duplicates.drop_duplicates() # Drop duplicate rows print(df_deduplicated) ree# Data transformation dF[‘Age'] = df[*Age’] +2 # Add 2 to each Age value printf) Name Age City mice “27 New York ( e 1 Bob 32 _London 2 Charlie 37 Paris 3 David 42 Tokyo Assignments: 1. Create a Series with the following data: 25, 30, 35, 40, 45, 50, 55, 60. Set ct arecerarert art: 2. Create a DataFrame with the following data: Name Age City emily a7 Jecob 31 La Emma 29 Pais Benjamin 33 Sydney 1. Access the ‘Age’ column of the DataFrame. 2. Access the ‘City’ value o ith index label 'c'. 3. Replace the ‘Age’ va ew\with index label 'e' to 48. 4, Drop the ‘City’ Conclusion: In this practical, we explored the Pahidas library and learned about its primary data res, Series, and DataFrame, We performed various operations like data exploration, cleaning, and data transformation using Pandas functions. Pandas is an essential tool manipulation and analysis in data science projects.
You might also like
Cheat Sheet: The Pandas Dataframe Object: Column Index (DF - Columns)
PDF
No ratings yet
Cheat Sheet: The Pandas Dataframe Object: Column Index (DF - Columns)
6 pages
Unit 4
PDF
No ratings yet
Unit 4
36 pages
FDS Module 2 Notes
PDF
No ratings yet
FDS Module 2 Notes
24 pages
The Pandas Library
PDF
No ratings yet
The Pandas Library
39 pages
P03 Introduction To Pandas Ans
PDF
No ratings yet
P03 Introduction To Pandas Ans
45 pages
Lab-3 Pandas Library
PDF
No ratings yet
Lab-3 Pandas Library
14 pages
Python Data Frame New
PDF
No ratings yet
Python Data Frame New
32 pages
Introduction To Pandas For Data Analysis
PDF
No ratings yet
Introduction To Pandas For Data Analysis
6 pages
Pandas 1
PDF
No ratings yet
Pandas 1
89 pages
04 Introduction To Python-1
PDF
No ratings yet
04 Introduction To Python-1
29 pages
IP 12th Chapter 3
PDF
No ratings yet
IP 12th Chapter 3
9 pages
Pandas_Notes
PDF
No ratings yet
Pandas_Notes
6 pages
IP Slybuss
PDF
No ratings yet
IP Slybuss
21 pages
Python Pandas
PDF
No ratings yet
Python Pandas
13 pages
Unit 2
PDF
No ratings yet
Unit 2
81 pages
JOINS (1)
PDF
No ratings yet
JOINS (1)
10 pages
Pandas Notes(1)
PDF
No ratings yet
Pandas Notes(1)
44 pages
DWV Unit1
PDF
No ratings yet
DWV Unit1
102 pages
Unit I: Data Handling Using Pandas and Data Visualization: Marks:30
PDF
No ratings yet
Unit I: Data Handling Using Pandas and Data Visualization: Marks:30
75 pages
Class Notes: Class: XII Date: 7-Apr-2020 Subject: Informatics Practices Topic: 2. Python Pandas
PDF
No ratings yet
Class Notes: Class: XII Date: 7-Apr-2020 Subject: Informatics Practices Topic: 2. Python Pandas
4 pages
L32, 33 Pandas
PDF
No ratings yet
L32, 33 Pandas
7 pages
UNIT 3(Chapter 2) Pandas
PDF
No ratings yet
UNIT 3(Chapter 2) Pandas
43 pages
python unit 3 4
PDF
No ratings yet
python unit 3 4
92 pages
14_Pandas
PDF
No ratings yet
14_Pandas
25 pages
Pandas Cheat Sheet
PDF
No ratings yet
Pandas Cheat Sheet
1 page
UNIT II Material
PDF
No ratings yet
UNIT II Material
34 pages
4 Data Transformation Using Pandas
PDF
No ratings yet
4 Data Transformation Using Pandas
59 pages
Python Pandas - I
PDF
No ratings yet
Python Pandas - I
32 pages
Unit-4Introduction To Pandas
PDF
No ratings yet
Unit-4Introduction To Pandas
44 pages
Python Pandas New Sylabus
PDF
No ratings yet
Python Pandas New Sylabus
53 pages
exp3 python (1)
PDF
No ratings yet
exp3 python (1)
15 pages
Pandas python
PDF
No ratings yet
Pandas python
11 pages
Pandas Basics Cheat Sheet Python For Data Science: Retrieving Series/Dataframe Information
PDF
No ratings yet
Pandas Basics Cheat Sheet Python For Data Science: Retrieving Series/Dataframe Information
1 page
python 2.1.2 (2)
PDF
No ratings yet
python 2.1.2 (2)
7 pages
Day64 - Pandas Interview Questions
PDF
No ratings yet
Day64 - Pandas Interview Questions
5 pages
Unit III - Pandas - Data Manipulation Using Python
PDF
No ratings yet
Unit III - Pandas - Data Manipulation Using Python
15 pages
DataFrame.docx
PDF
No ratings yet
DataFrame.docx
95 pages
18_Pandas
PDF
No ratings yet
18_Pandas
33 pages
06 MGMT 590 Fall 2019 Data Handling With Pandas(1)
PDF
No ratings yet
06 MGMT 590 Fall 2019 Data Handling With Pandas(1)
14 pages
Pandas PDF(2)
PDF
No ratings yet
Pandas PDF(2)
25 pages
Python Pandas
PDF
No ratings yet
Python Pandas
21 pages
Pandas
PDF
No ratings yet
Pandas
12 pages
Pandas
PDF
No ratings yet
Pandas
82 pages
Pandas Dataframe Export The CSV File
PDF
No ratings yet
Pandas Dataframe Export The CSV File
9 pages
Python Data Processing
PDF
No ratings yet
Python Data Processing
36 pages
Pandas
PDF
No ratings yet
Pandas
4 pages
2.1 Pandas Objects
PDF
No ratings yet
2.1 Pandas Objects
10 pages
Ii Unit Pandas
PDF
No ratings yet
Ii Unit Pandas
30 pages
DV
PDF
No ratings yet
DV
53 pages
Python Pandas ch-2
PDF
No ratings yet
Python Pandas ch-2
56 pages
Data Analytics Using Python
PDF
No ratings yet
Data Analytics Using Python
22 pages
Python Pandas Module - Introduction-07-11-2023
PDF
No ratings yet
Python Pandas Module - Introduction-07-11-2023
84 pages
Python 3rd unit question and answer
PDF
No ratings yet
Python 3rd unit question and answer
25 pages
Introduction To Pandas - Ipynb - Colaboratory
PDF
No ratings yet
Introduction To Pandas - Ipynb - Colaboratory
7 pages
Class 12 Panda Project
PDF
No ratings yet
Class 12 Panda Project
13 pages
Ai Workflow Data Preparation With Numpy and Pandas: MR Hew Ka Kian Hew - Ka - Kian@Rp - Edu.Sg
PDF
No ratings yet
Ai Workflow Data Preparation With Numpy and Pandas: MR Hew Ka Kian Hew - Ka - Kian@Rp - Edu.Sg
26 pages
Python Pandas1
PDF
No ratings yet
Python Pandas1
39 pages
Data Science With Python - Lesson 07 - Data Manipulation With Python - Pandas
PDF
No ratings yet
Data Science With Python - Lesson 07 - Data Manipulation With Python - Pandas
72 pages
Python Pandas I - Operations On Rows and Columns
PDF
No ratings yet
Python Pandas I - Operations On Rows and Columns
15 pages