2

I have some 2-dimensional data of shape (1024, 4) that is stored as an array to a binary file in NumPy .npy format.

arr = np.array(<some >)
arr.shape
# >>> (1024, 4)

np.save(fileName, arr)
# >>> .../SomeData.npy

How can I import this data into a Swift Array? It would have helped me if the data were read column by column.

Finally I want to have something like this:

let imported : [Float] = ???
J.E.K
  • 1,321
  • 10
  • 17

0 Answers0