Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: distance arg of np.gradient must be scalar, fix docstring #7618

Merged
merged 1 commit into from
May 11, 2016

Conversation

ahaldane
Copy link
Member

Fixups to docstring, and disallow non-scalars as the distance args to
np.gradient.

Fixes #7548, fixes #6847

Fixups to docstring, and disallow non-scalars as the distance args to
np.gradient.

Fixes numpy#7548, fixes numpy#6847
@charris charris merged commit a7e9f45 into numpy:master May 11, 2016
@charris
Copy link
Member

charris commented May 11, 2016

Thanks Allan.

apbard added a commit to apbard/numpy that referenced this pull request Feb 22, 2017
This somehow reverts numpy#7618 and solves numpy#6847, numpy#7548 by implementing
support for unevenly spaced data. Now the behaviour is similar to
that of Matlab/Octave function. As argument it can take:
1. A single scalar to specify a sample distance for all dimensions.
2. N scalars to specify a constant sample distance for each dimension.
   i.e. `dx`, `dy`, `dz`, ...
3. N arrays to specify the coordinates of the values along each
   dimension of F. The length of the array must match the size of
   the corresponding dimension
4. Any combination of N scalars/arrays with the meaning of 2. and 3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

numpy.gradient inconsistent returns docstring on gradient, confusing
2 participants