Syed Abeed has Published 40 Articles

Python – numpy.meshgrid

Syed Abeed

Syed Abeed

Updated on 03-Mar-2022 07:28:05

897 Views

numpy.meshgrid() is used to return coordinate matrices from coordinate vectors. Its syntax is as follows −numpy.meshgrid(*xi, **kwargs)ParametersMeshgrid can accept the following parameters −x1, x2, …, xn − It represents the coordinates of a grid.indexing − It is an optional parameter which defines the Cartesian 'xy' by default and matrix 'ij' ... Read More

Python – numpy.reshape

Syed Abeed

Syed Abeed

Updated on 03-Mar-2022 07:19:58

496 Views

numpy.reshape() gives a new shape to an array without changing its data. Its syntax is as follows −numpy.reshape(arr, newshape, order='C')Parametersnumpy.reshape() can accept the following parameters −arr − Input array.shape − endpoint of the sequencenewshape − If an integer, then the result it will be a 1-D array of that length, ... Read More

Python – numpy.geomspace

Syed Abeed

Syed Abeed

Updated on 03-Mar-2022 07:14:26

536 Views

numpy.geomspace() returns a set of numbers spaced evenly on a log scale (a geometric progression).Linspace − It is similar to geomspace, but endpoints specified using the log and base.Logspace − It is similar to geomspace, but endpoints specified with arithmetic instead of geometric progression.Syntaxnumpy.goemspace(start, stop, num = 50, endpoint = ... Read More

Python – numpy.logspace

Syed Abeed

Syed Abeed

Updated on 03-Mar-2022 07:11:59

391 Views

numpy.logspace returns a set of numbers spaced evenly on a log scale. Its syntax is as follows −numpy.logspace(start, stop, num = 50, endpoint = True/False, base = 10.0, dtype = None)ParametersThe logspace function can accept the following parameters −start − Start of the sequence; default is zero.stop − Endpoint of ... Read More

Python – numpy.linspace

Syed Abeed

Syed Abeed

Updated on 03-Mar-2022 07:05:40

2K+ Views

The numpy.linspace function is used to create a set of evenly spaced numbers within a defined interval.Syntaxnumpy.linspace(start, stop, num = 50, endpoint = True/False, retstep = False/True, dtype = None)ParametersThe function can accept the following parameters −start − Start of the sequence; by default, it is considered as zero.stop − ... Read More

numpy.matrix Method in Python

Syed Abeed

Syed Abeed

Updated on 11-Feb-2022 06:41:54

193 Views

The numpy.matrix method is used to interpret a given input as a matrix. It returns a matrix from an array-like object. Its syntax is as follows −numpy.matrix(data, dtype=None, copy=bool)where, data - It is the input data.dtype - It represents the data type of the output matrix.copy - If the input ... Read More

numpy.triu Method in Python

Syed Abeed

Syed Abeed

Updated on 11-Feb-2022 06:38:25

475 Views

The numpy.triu() method can be used to get the upper triangle of an array. Its syntax is as follows −Syntaxnumpy.triu(m, k=0)where, m - number of rows in the array.k - It is the diagonal. Use k=0 for the main diagonal. k < 0 is below the main diagonal and k ... Read More

numpy.vander Method in Python

Syed Abeed

Syed Abeed

Updated on 11-Feb-2022 06:34:18

288 Views

The numpy.vander() method is used to generate a Vandermonde (Vander) matrix. A Vander matrix contains a geometric progression in each row, for example, $$\mathrm{A =\begin{bmatrix}1 & 2 & 4 \1 & 3 & 9 \1 & 5 &25\end{bmatrix} or\: B = \begin{bmatrix}1 & 4 & 16 \1 & 6 &36 ... Read More

numpy.tril Method in Python

Syed Abeed

Syed Abeed

Updated on 11-Feb-2022 06:29:46

281 Views

We can use the numpy.tril() method to get the lower triangle of an array. Its syntax is as followsSyntaxnumpy.tril(m, k=0)where, m - number of rows in the array.k - It is the diagonal. Use k=0 for the main diagonal. k < 0 is below the main diagonal and k > ... Read More

numpy.tri Method in Python

Syed Abeed

Syed Abeed

Updated on 11-Feb-2022 05:59:23

317 Views

The numpy.tri method can be used to get an array of 1's at and below a given diagonal and 0's elsewhere.Syntaxnumpy.tri(N, M=None, k=0, dtype=)Parametersnumpy.tri accepts the following parameters −N - It defines the number of the rows in an array.M - It defines the number of columns in an array. ... Read More

Advertisements