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
lengthand 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
lengthand elements of valuescalar.- Return type:
np.ndarray
- Raises:
TypeError – When
scalaris not of a supported type