Learn practical skills, build real-world projects, and advance your career

5 Interesting Numpy functions

Interesting Numpy functions that you might find useful

Numpy is a open-source Python library for scientific computations. It includes easy to use functions for mathematical computations on the array data set that helps in basic mathematical calculations and also in the process of creating advanced machine learning and artificial intelligence applications easier

  • swapaxes()
  • repeat()
  • split()
  • rot90()
  • insert()

The recommended way to run this notebook is to click the "Run" button at the top of this page, and select "Run on Binder". This will run the notebook on mybinder.org, a free online service for running Jupyter notebooks.

Let's begin by importing Numpy and listing out the functions covered in this notebook.

import numpy as np
# List of functions explained 
function1 = np.swapaxes  # (change this)
function2 = np.repeat
function3 = np.split
function4 = np.rot90
function5 = np.insert

Function 1 - np.swapaxes

Used to intechange two axes of an array.

Syntax:
numpy.swapaxes(a, axis1, axis2)

 a: input array
 axis1: first axis that is to be swapped
 axis2: second axis that is to be swapped