Numpy

Numpy commands for managing numerical computing, linear algebra, and random number generation

16 commands

Commands

16 commands available
numpy

Import NumPy

Import NumPy library in Python

import numpy as np
numpy
import
setup
numpy

Create Array

Create a NumPy array

np.array([1,2,3])
numpy
array
create
numpy

Arange

Create array with evenly spaced values

np.arange(start, stop, step)
numpy
array
sequence
numpy

Linspace

Create array with evenly spaced numbers over interval

np.linspace(start, stop, num)
numpy
array
sequence
numpy

Zeros

Create array filled with zeros

np.zeros((rows, cols))
numpy
array
init
numpy

Ones

Create array filled with ones

np.ones((rows, cols))
numpy
array
init
numpy

Random Numbers

Generate random numbers

np.random.rand() / np.random.randint()
numpy
array
random
numpy

Array Shape

Get shape of array

arr.shape
numpy
array
info
numpy

Reshape

Reshape an array

arr.reshape(new_shape)
numpy
array
reshape
numpy

Sum

Compute sum of array elements

np.sum(arr, axis)
numpy
math
aggregate
numpy

Mean

Compute mean of array elements

np.mean(arr, axis)
numpy
math
aggregate
numpy

Standard Deviation

Compute standard deviation

np.std(arr)
numpy
math
aggregate
numpy

Dot Product

Matrix dot product

np.dot(arr1, arr2)
numpy
math
matrix
numpy

Transpose

Transpose an array

arr.T
numpy
array
matrix
numpy

Max & Min

Find maximum and minimum values

np.max(arr), np.min(arr)
numpy
math
aggregate
numpy

Indexing & Slicing

Access array elements by index

arr[row, col]
numpy
array
indexing