Closed mdhoney closed 1 year ago
numpy.complex64
corresponds to Complex<f32>
, and numpy.complex128
corresponds to Complex<f64>
. If you change your code to let rB1D_holo_pad: Result<Array1<Complex<f32>>, ReadNpyError> = ...
, it should work.
The error message is saying that the type descriptor in the header of the .npy
file is the string "<c8"
, which doesn't match the Complex<f64>
element type. The string type descriptors are described on NumPy's data type objects documentation page.
numpy.complex64
corresponds toComplex<f32>
, andnumpy.complex128
corresponds toComplex<f64>
. If you change your code tolet rB1D_holo_pad: Result<Array1<Complex<f32>>, ReadNpyError> = ...
, it should work.
It did! Thanks for helping me catch this beginner's mistake @jturner314 :smile:
Okay, great! I'm closing this issue as completed.
I'm trying to read in a
.npy
file previously written with Python:Unfortunately, using
read_npy
gives me a "WrongDescriptor" error that I don't understand:Err(WrongDescriptor(String("<c8")))
Here is my code:
ndarray-npy should be able to read
Complex<f64>
ndarrays, right?