Open TheTomer opened 3 years ago
@TheTomer I am afraid cnpy can not work in this case, numpy use pickle to serialize array when your array is not a normal one
Thanks @eedalong . I ended up going with another approach, I've converted the structs vector into multiple vectors of the same type and saved them as an npz file. My only problem now is that I couldn't manage to save a vector of strings using cnpy.
yeah,i guess that is because string'e length is variant, so if we want serialize a vector of strings, we need to serialize it as [length1][string1][length2][string2][length3][string3]
Hi, I'm not sure how cnpy is supposed to work in the following case: Let's say I have a vector of structs. The struct is made of an int field and a double field. The is supposed to be translated into a 2D matrix, with each column having a different variable type. How would you use cnpy to save that structure into a npy file?
In Python, with Numpy, it's possible to use a record array, as described in this thread.