numpy.outer() function - Python Last Updated : 05 May, 2020 Comments Improve Suggest changes Like Article Like Report numpy.outer() function compute the outer product of two vectors. Syntax : numpy.outer(a, b, out = None) Parameters : a : [array_like] First input vector. Input is flattened if not already 1-dimensional. b : [array_like] Second input vector. Input is flattened if not already 1-dimensional. out : [ndarray, optional] A location where the result is stored. Return : [ndarray] Returns the outer product of two vectors. out[i, j] = a[i] * b[j] Code #1 : Python3 # Python program explaining # numpy.outer() function # importing numpy as geek import numpy as geek a = geek.ones(4) b = geek.linspace(-1, 2, 4) gfg = geek.outer(a, b) print (gfg) Output : [[-1. 0. 1. 2.] [-1. 0. 1. 2.] [-1. 0. 1. 2.] [-1. 0. 1. 2.]] Code #2 : Python3 # Python program explaining # numpy.outer() function # importing numpy as geek import numpy as geek a = geek.ones(5) b = geek.linspace(-2, 2, 5) gfg = geek.outer(a, b) print (gfg) Output : [[-2. -1. 0. 1. 2.] [-2. -1. 0. 1. 2.] [-2. -1. 0. 1. 2.] [-2. -1. 0. 1. 2.] [-2. -1. 0. 1. 2.]] Comment More infoAdvertise with us Next Article numpy.outer() function - Python S sanjoy_62 Follow Improve Article Tags : Machine Learning Python-numpy python Practice Tags : Machine Learningpython Similar Reads numpy.i0() function | Python numpy.i0() function is the modified Bessel function of the first kind, order 0. it's usually denoted by I0. Syntax : numpy.i0(x) Parameters : x : [array_like, dtype float or complex] Argument of the Bessel function. Return : [ndarray, shape = x.shape, dtype = x.dtype] The modified Bessel function ev 1 min read numpy.who function - Python numpy.who() function print the NumPy arrays in the given dictionary. Syntax : numpy.who(vardict = None) Parameters : vardict : [dict, optional] A dictionary possibly containing ndarrays. Return : Returns âNoneâ. If there is no dictionary passed in or vardict is None then returns NumPy arrays in the 1 min read numpy.pad() function in Python numpy.pad() function is used to pad the Numpy arrays. Sometimes there is a need to perform padding in Numpy arrays, then numPy.pad() function is used. The function returns the padded array of rank equal to the given array and the shape will increase according to pad_width. Syntax: numpy.pad(array, p 2 min read numpy.matrix.A() function - Python numpy.matrix.A() function return self as an ndarray object. Syntax : numpy.matrix.A() Parameters : None Return : [ndarray] Return self as an ndarray. Code #1 : Python3 # Python program explaining # numpy.matrix.A() function # importing numpy as geek import numpy as geek mat = geek.matrix(geek.arange 1 min read numpy.fromiter() function â Python NumPy's fromiter() function is a handy tool for creating a NumPy array from an iterable object. This iterable can be any Python object that provides elements one at a time. The function is especially useful when you need to convert data from a custom data source, like a file or generator, into a Num 2 min read Like