This repository is a structured guide to mastering array indexing and slicing in NumPy, one of the most important skills for data analysis and numerical computing in Python.
It features 15 hands-on tasks, starting from simple 1D indexing to advanced 3D slicing and boolean operations.
Perfect for beginners and learners who want to build a strong foundation in NumPy array manipulation.
🧪 Task File | 📄 Description | 📷 Output Screenshot |
---|---|---|
task 1.py | 🎯 1D Array Indexing (first, third, last element) | ![]() |
task 2.py | 🎯 2D Array Indexing (row/column elements) | ![]() |
task 3.py | 🎯 3D Array Indexing (block, row, col) | ![]() |
task 4.py | ✨ Fancy Indexing (extracting elements using index lists) | ![]() |
task 5.py | ✅ Boolean Indexing (conditions: greater than, even numbers) | ![]() |
task 6.py | ✂️ 1D Array Slicing (range, step, reverse) | ![]() |
task 7.py | ✂️ 2D Slicing – Rows (first two, last two rows) | ![]() |
task 8.py | ✂️ 2D Slicing – Columns (first two, last column) | ![]() |
task 9.py | 🔲 Sub-matrix Extraction (top-left & bottom-right) | ![]() |
task 10.py | ![]() |
|
task 11.py | 🧊 3D Slicing – Blocks (first block, second block) | ![]() |
task 12.py | 🧊 3D Slicing – Rows & Columns (first row, last col of each block) | ![]() |
task 13.py | 🎯 Mixed Indexing + Slicing (single element + submatrix) | ![]() |
task 14.py | ✅ Boolean + Slicing (conditions + last 3 elements) | ![]() |
task 15.py | 🚀 Advanced 3D Mixed (middle block, last row, condition-based) | ![]() |
🔹 Accessing elements using basic indexing (1D, 2D, 3D)
🔹 Extracting data using fancy indexing
🔹 Filtering arrays using boolean masks
🔹 Performing slicing operations (range, step, reverse)
🔹 Extracting sub-matrices & blocks in 3D arrays
🔹 Combining indexing, slicing & conditions for advanced use cases
📊 Sunil Kumar Reddy Punnati
🎓 MCA Graduate | 💼 Data Analyst Intern
📍 Tirupati, India
💡 Passionate about Python, NumPy, data analysis, and building impactful projects.
🚀 Actively preparing for full-time roles in Data Analytics & Software Development.
🌐 [LinkedIn]-(https://www.linkedin.com/in/sunil-kumar-reddy-punnati-a0a279308/)
💻 [GitHub]-(https://github.com/sunilkumarreddypunnati)
If you’re a recruiter, mentor, or fellow learner — let’s connect and grow together!
⭐ Star this repo if you found it helpful or inspiring.
A curated set of 15 NumPy Indexing & Slicing tasks that progress from beginner to advanced concepts.
Each task includes Python code, explanations, and output screenshots to help learners practice and build confidence in NumPy array manipulation.