Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Class notes Class 12 board

Rating
-
Sold
-
Pages
46
Uploaded on
03-03-2025
Written in
2024/2025

It will help students in exam time. It will help students to revise concepts in less time.

Institution
Course

Content preview

Visit Python4csip.com for more updates

CHAPTER-1 Data Handling using Pandas –I

Pandas:
• It is a package useful for data analysis and manipulation.
• Pandas provide an easy way to create, manipulate and wrangle the
data.
• Pandas provide powerful and easy-to-use data structures, as well
as the means to quickly perform operations on these structures.

Data scientists use Pandas for its following advantages:

• Easily handles missing data.
• It uses Series for one-dimensional data structure and DataFrame
for multi-dimensional data structure.
• It provides an efficient way to slice the data.
• It provides a flexible way to merge, concatenate or reshape the
data.

DATA STRUCTURE IN PANDAS
A data structure is a way to arrange the data in such a way that so it
can be accessed quickly and we can perform various operation on this
data like- retrieval, deletion, modification etc.

Pandas deals with 3 data structure-

1. Series
2. Data Frame
3. Panel

We are having only series and data frame in our syllabus.




CREATED BY: SACHIN BHARDWAJ PGT(CS) KV NO1 TEZPUR, VINOD VERMA PGT (CS) KV OEF KANPUR

, Visit Python4csip.com for more updates
Series
Series-Series is a one-dimensional
DATAFEAME array like structure with
homogeneous data, which can be used to handle and manipulate data.
What makes it special is its index attribute, which has incredible
functionality and is heavily mutable.

It has two parts-
1. Data part (An array of actual data)
2. Associated index with data (associated array of indexes or data labels)

e.g.-


Index Data

0 10

1 15

2 18

3 22




✓ We can say that Series is a labeled one-dimensional array
which can hold any type of data.
✓ Data of Series is always mutable, means it can be changed.
✓ But the size of Data of Series is always immutable, means it
cannot be changed.
✓ Series may be considered as a Data Structure with two
arrays out which one array works as Index (Labels) and the
second array works as original Data.
✓ Row Labels in Series are called Index.



CREATED BY: SACHIN BHARDWAJ PGT(CS) KV NO1 TEZPUR, VINOD VERMA PGT (CS) KV OEF KANPUR

, Visit Python4csip.com for more updates
Syntax to create a Series:

<Series Object>=pandas.Series (data, index=idx (optional))

✓ Where data may be python sequence (Lists), ndarray,
scalar value or a python dictionary.




How to create Series with nd array
DATAFEAME
Program-

import pandas as pd
Output-
import numpy as np Default Index
0 10
arr=np.array([10,15,18,22])
1 15
s = pd.Series(arr) 2 18

print(s) 3 22

Data
Here we create an
array of 4 values.




CREATED BY: SACHIN BHARDWAJ PGT(CS) KV NO1 TEZPUR, VINOD VERMA PGT (CS) KV OEF KANPUR

, Visit Python4csip.com for more updates

How to create Series with Mutable index
DATAFEAME
Program-

import pandas as pd Output-
import numpy as np first a
arr=np.array(['a','b','c','d']) second b
third c
s=pd.Series(arr,
fourth d
index=['first','second','third','fourth'])

print(s)




CREATED BY: SACHIN BHARDWAJ PGT(CS) KV NO1 TEZPUR, VINOD VERMA PGT (CS) KV OEF KANPUR

Written for

Course

Document information

Uploaded on
March 3, 2025
Number of pages
46
Written in
2024/2025
Type
Class notes
Professor(s)
Vishal kumar
Contains
All classes

Subjects

$11.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
kartik7

Also available in package deal

Get to know the seller

Seller avatar
kartik7
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 year
Number of followers
0
Documents
3
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions