BetterDocs
Home
Docs

Creation | np.vander()

Method:

np.vander(x, N=None, increasing=False)

Generates a Vandermonde matrix from a vector.

Returns:

np.ndarray

Parameters:

x: array-like-

The input vector.

import numpy as np
result = np.vander(x=[4, 2, 3])
print(result)
'''
Output:
[[16  4  1]
 [ 4  2  1]
 [ 9  3  1]]
'''

N: int, Optional-

The number of columns in the output matrix (default is len(x)).

import numpy as np
result = np.vander(x=[4, 2, 3], N=4)
print(result)
'''
Output:
[[64 16  4  1]
 [ 8  4  2  1]
 [27  9  3  1]]
'''

increasing: (True or False), Optional-

If True, the powers of x are in increasing order (default False).

increasing = False (default) +

increasing = True +


Logo

BetterDocs

Support

EmailDiscordForms

Documentations

Python

Company

AboutDocs

Policies

Terms of ServicePrivacy Policy