import numpy as np import numpy.typing as npt # Type that allows both a number or an array float_or_array = float | npt.NDArray[np.double]