Skip to content

Practice codes and examples of NumPy basics including array creation, indexing, slicing, broadcasting, random functions, and visualization with Matplotlib.

Notifications You must be signed in to change notification settings

Sidra-009/Numpy-Practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 

Repository files navigation

NumPy Practice πŸπŸ“Š

This repository contains my practice work on NumPy, one of the most popular Python libraries for numerical computing.
It includes examples of array creation, indexing, slicing, broadcasting, random number generation, mathematical operations, and visualization with Matplotlib.


πŸ“Œ Contents

The file demonstrates:

  • Array Creation & Properties
    • 1D, 2D, 3D arrays
    • shape, ndim, size, dtype, itemsize
    • zeros, ones, identity, arange, linspace
  • Indexing & Slicing
    • Row & column selection
    • Fancy indexing
    • Boolean indexing
  • Mathematical Operations
    • Element-wise operations
    • Scalar multiplication
    • Dot product
    • Aggregate functions (sum, mean, std, min, max, etc.)
  • Broadcasting
    • Explained with practical scenarios
  • Random Number Generation
    • randint, uniform, random, seed
  • Problem-Solving with NumPy
    • Replace odd numbers with -1
    • Sorting arrays
    • Percentile calculations
  • Visualization with Matplotlib
    • Sine curve
    • Quadratic function

πŸš€ Getting Started

Clone the repository:

https://github.com/Sidra-009/Numpy-Practice.git
Navigate into the repo:

bash
Copy code
cd numpy-practice
Run the Python file (or open in Jupyter Notebook):

bash
Copy code
python numpy_practice.py
πŸ“· Preview
Some examples from the code:

βœ… Sin curve plotted using np.linspace + matplotlib

βœ… Quadratic function visualization

βœ… Boolean indexing to filter values

βœ… Broadcasting examples explained with code

πŸ“š Requirements
Python 3.x

NumPy

Matplotlib

Install dependencies:

bash
Copy code
pip install numpy matplotlib
✨ Author
Sidra Saqlain

🌟 If you find this helpful, don’t forget to give the repo a ⭐!

About

Practice codes and examples of NumPy basics including array creation, indexing, slicing, broadcasting, random functions, and visualization with Matplotlib.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published