summaryrefslogtreecommitdiff
path: root/numpy/fft/helper.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2010-05-10 03:41:02 +0000
committerCharles Harris <charlesr.harris@gmail.com>2010-05-10 03:41:02 +0000
commit427a9632db6ddc1e8659ab3191fe63873a8a188b (patch)
treec79dd77a275676ad62c9f3fd0d043044884a91a5 /numpy/fft/helper.py
parent81a86c775143d7335613fdb960d6267fc3d602f8 (diff)
downloadnumpy-427a9632db6ddc1e8659ab3191fe63873a8a188b.tar.gz
BUG: Make fftshift and ifftshift accept integer arguments for the axes
value. The functions now match their documentation. Fixes ticket #1182, patch from rgommers.
Diffstat (limited to 'numpy/fft/helper.py')
-rw-r--r--numpy/fft/helper.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/fft/helper.py b/numpy/fft/helper.py
index 8bd2564de..f6c570445 100644
--- a/numpy/fft/helper.py
+++ b/numpy/fft/helper.py
@@ -7,6 +7,7 @@ __all__ = ['fftshift','ifftshift','fftfreq']
from numpy.core import asarray, concatenate, arange, take, \
integer, empty
+import numpy.core.numerictypes as nt
import types
def fftshift(x,axes=None):
@@ -57,6 +58,8 @@ def fftshift(x,axes=None):
ndim = len(tmp.shape)
if axes is None:
axes = range(ndim)
+ elif isinstance(axes, (int, nt.integer)):
+ axes = (axes,)
y = tmp
for k in axes:
n = tmp.shape[k]
@@ -103,6 +106,8 @@ def ifftshift(x,axes=None):
ndim = len(tmp.shape)
if axes is None:
axes = range(ndim)
+ elif isinstance(axes, (int, nt.integer)):
+ axes = (axes,)
y = tmp
for k in axes:
n = tmp.shape[k]