Closed
Description
x = np.arange(20)
np.gradient(x)
returns an array. While,
x = np.arange(20)
x = x.resape(10,2)
np.gradient(x)
returns a list of arrays. For consistency the returns should be the same or force a default axis=0 argument so that an array is always returned.
As a side note, it would be nice if gradient could handle the following...
x = np.arange(20)
x = x.resape(10,2,1)
np.gradient(x)
ValueError: Shape of array too small to calculate a numerical gradient, at least two elements are required.
and only fail if the user requests the gradient along the signal element axis.
Metadata
Metadata
Assignees
Labels
No labels