havakok
havakok

Reputation: 1247

'TypeError: a float is required' error when applying numpy fft on conjugate of numpy ndarray

I have a numpy array X. I need an fft on the conjugate of that array. The following cod:

      print(type(X.conjugate))
      print(type(M))

      Xf = np.fft.fft(X.conjugate, M).conjugate

produces:

< class 'builtin_function_or_method'>

< class 'numpy.float64'>

With the error massage:

line 189, in fft a = asarray(a).astype(complex, copy=False) TypeError: a float is required

In python3.5/site-packages/numpy/fft/fftpack.py .

when printing print(type(X)) I get

< class 'numpy.ndarray'>

Upvotes: 0

Views: 103

Answers (1)

ggjm
ggjm

Reputation: 26

Instead of using X.conjugate method, have you tried using numpy.conj?

Since it's an array, I don't think the X.conjugate method is returning a complex array.

Upvotes: 1

Related Questions