-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
DOC: indices on numpy.fft.ifft #28914
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
Comments
I think you are right. Would you like to open a PR to fix this? |
Hmm maybe not a good idea as I am not skilled with it.. but I can see the tutorial when I have a chance |
@saulopo The next line in the doc says that "For an even number of input points, However, I believe the correct way to write it is
For example import numpy as np
n=5 # odd
a = np.arange(n)
a[1:(n+1)//2]
# array([1, 2])
a[n//2 + 1:]
# array([3, 4])
n=6 # even
a = np.arange(n)
a[1:(n+1)//2]
# array([1, 2])
a[n//2 + 1:]
# array([4, 5])
a[n//2]
# np.int64(3) |
Thanks @vtavana , I see what you mean. |
Issue with current documentation:
https://numpy.org/doc/stable/reference/generated/numpy.fft.ifft.html#numpy.fft.ifft
In the description "The input should be ordered in the same way as is returned by fft, i.e.,
shouldn't "a[n//2 + 1:]" be "a[n//2:]" ? The former item (a[1:n//2]) ranges from 1 to n//2-1.
Idea or request for content:
No response
The text was updated successfully, but these errors were encountered: