Numpy & Arrays

Numpy & Arrays

Introduction To Numpy

Numpy is a powerful library in Python designed for scientific computing and manipulating data.

Numpy Arrays

Arrays are homogenous in nature. They contain the same datatype.

1-Dimensional array

This is how we declare an array in Numpy.

This shows that array1 is an n-dimensional array.

To print the dimensions of an array

To print the shape of an array

This indicates the array has 5 elements along 1 axis.

Slicing operation in 1-D arrays.

2-Dimensional array

other attributes of 2-dimensional arrays that we can check

slicing operation in 2-D arrays

3-Dimensional Array

This is how we declare a 3-D array.

Some other operations that we can perform on a 3-D array

Axis

It is a pointer that tells in which direction you are traveling across an array.