MCPcopy Index your code
hub / github.com/numpy/numpy / original_ifftshift

Method original_ifftshift

numpy/fft/tests/test_helper.py:106–120  ·  view source on GitHub ↗

How ifftshift was implemented in v1.14

(x, axes=None)

Source from the content-addressed store, hash-verified

104 return y
105
106 def original_ifftshift(x, axes=None):
107 """ How ifftshift was implemented in v1.14 """
108 tmp = asarray(x)
109 ndim = tmp.ndim
110 if axes is None:
111 axes = list(range(ndim))
112 elif isinstance(axes, int):
113 axes = (axes,)
114 y = tmp
115 for k in axes:
116 n = tmp.shape[k]
117 p2 = n - (n + 1) // 2
118 mylist = concatenate((arange(p2, n), arange(p2)))
119 y = take(y, mylist, k)
120 return y
121
122 # create possible 2d array combinations and try all possible keywords
123 # compare output to original functions

Callers

nothing calls this directly

Calls 3

asarrayFunction · 0.90
concatenateFunction · 0.90
takeFunction · 0.90

Tested by

no test coverage detected