Skip to content

sunilkumarreddypunnati/numpy-array-indexing-slicing

Repository files navigation

🔢 Indexing & Slicing in NumPy Arrays

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 Progression: Beginner ➡️ Advanced

🧪 Task File 📄 Description 📷 Output Screenshot
task 1.py 🎯 1D Array Indexing (first, third, last element) task 1.png
task 2.py 🎯 2D Array Indexing (row/column elements) task 2.png
task 3.py 🎯 3D Array Indexing (block, row, col) task 3.png
task 4.py ✨ Fancy Indexing (extracting elements using index lists) task 4.png
task 5.py ✅ Boolean Indexing (conditions: greater than, even numbers) task 5.png
task 6.py ✂️ 1D Array Slicing (range, step, reverse) task 6.png
task 7.py ✂️ 2D Slicing – Rows (first two, last two rows) task 7.png
task 8.py ✂️ 2D Slicing – Columns (first two, last column) task 8.png
task 9.py 🔲 Sub-matrix Extraction (top-left & bottom-right) task 9.png
task 10.py ↔️ Negative Slicing in 2D (reverse rows & columns) task 10.png
task 11.py 🧊 3D Slicing – Blocks (first block, second block) task 11.png
task 12.py 🧊 3D Slicing – Rows & Columns (first row, last col of each block) task 12.png
task 13.py 🎯 Mixed Indexing + Slicing (single element + submatrix) task 13.png
task 14.py ✅ Boolean + Slicing (conditions + last 3 elements) task 14.png
task 15.py 🚀 Advanced 3D Mixed (middle block, last row, condition-based) task 15.png

✅ What I Practiced

🔹 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


👨‍💻 About Me

📊 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.


🔗 Connect With Me

🌐 [LinkedIn]-(https://www.linkedin.com/in/sunil-kumar-reddy-punnati-a0a279308/)
💻 [GitHub]-(https://github.com/sunilkumarreddypunnati)


🙌 Connect & Support

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.


ℹ️ Summary

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages