extend_scalar#
- PySeismoSoil.helper_generic.extend_scalar(scalar: float | int | numpy.number, length: int) ndarray [source]#
“Extend” a scalar (float, int, or numpy.number type) into a 1D numpy array whose length is
length
and whose elements are allscalar
.- Parameters:
scalar (float | int | np.number) – A single number.
length (int) – The length of the desired output.
- Returns:
array – A 1D numpy array with length
length
and elements of valuescalar
.- Return type:
np.ndarray
- Raises:
TypeError – When
scalar
is not of a supported type