📘 PAPER 2: OBJECT ORIENTED PROGRAMMING WITH PYTHON UNIT 5 – NumPy and Pandas (university of allahabad)
🔴 UNIT 5 – NumPy and Pandas
🟦 PART A: NUMPY (Numerical Python)
1️⃣ Introduction to NumPy
✅ What is NumPy?
NumPy is a Python library used for:
-
Numerical computation
-
Scientific computing
-
Working with arrays and matrices
✅ Features of NumPy
✔ Faster than Python lists
✔ Supports multi-dimensional arrays
✔ Efficient memory usage
✔ Used in ML, AI, Data Science
2️⃣ ndarray (N-Dimensional Array)
Definition:
The main object of NumPy is ndarray, which represents a multi-dimensional array.
Example:
3️⃣ Data Types in NumPy
Common Data Types:
-
int
-
float
-
bool
-
complex
4️⃣ Array Attributes
| Attribute | Description |
|---|---|
| ndim | Number of dimensions |
| shape | Size of array |
| size | Total elements |
| dtype | Data type |
Example:
5️⃣ Array Creation Routines
🔹 From List
🔹 Zeros & Ones
🔹 Using arange()
🔹 Using linspace()
6️⃣ Array from Existing Data
7️⃣ Array Indexing & Slicing
8️⃣ Mathematical Operations
🟩 PART B: PANDAS
9️⃣ Introduction to Pandas
✅ What is Pandas?
Pandas is a Python library used for:
-
Data analysis
-
Data manipulation
-
Handling structured data
🔟 Pandas Data Structures
1️⃣ Series
A one-dimensional labeled array.
2️⃣ DataFrame
A two-dimensional table-like structure.
1️⃣1️⃣ Creating Series
From List
From Dictionary
From Scalar
1️⃣2️⃣ Creating DataFrame
From List
From Dictionary
1️⃣3️⃣ Manipulating DataFrames
Rename Column
Delete Column
Delete Row
1️⃣4️⃣ Handling Missing Values
Finding Missing Values
Filling Missing Values
Dropping Missing Values
1️⃣5️⃣ Advantages of Pandas
✔ Easy data handling
✔ Fast processing
✔ Data cleaning
✔ Used in ML & AI
Comments
Post a Comment