I am eager to share my knowledge with the world! This repository contains my implementations of basic operations using NumPy, a popular Python library for numerical computing. As part of my journey in the mathematics for machine learning course, I explored various functionalities of NumPy and documented my learning process here.
NumPy is a fundamental package for scientific computing in Python. It provides support for arrays, matrices, and many mathematical functions to operate on these data structures efficiently.
To install NumPy, you can use pip:
pip install numpy
Alternatively, if you are using Anaconda, you can install NumPy with:
conda install numpy
Learn how to create arrays from lists, use functions like arange
, linspace
, and create multidimensional arrays.
Explore reshaping arrays, indexing, slicing, and joining arrays.
Perform element-wise operations, use universal functions (ufuncs), and apply mathematical functions like sin
, cos
, and exp
.
Calculate mean, median, standard deviation, and other statistical measures on arrays.
Here are some examples of basic operations using NumPy:
import numpy as np
# Creating an array
arr = np.array([1, 2, 3, 4, 5])
print("Array:", arr)
# Array manipulation
reshaped_arr = arr.reshape((5, 1))
print("Reshaped Array:\n", reshaped_arr)
# Mathematical operations
squared_arr = np.square(arr)
print("Squared Array:", squared_arr)
# Statistical operations
mean_val = np.mean(arr)
print("Mean Value:", mean_val)
Feel free to fork this repository, create issues, or submit pull requests. Any contributions to enhance the examples or add more functionalities are welcome.
By sharing this repository, I hope to help others understand the basics of NumPy and encourage them to explore its powerful features in their own projects.