1

I need a function to turn bytes back to a numpy array. Is there a simple way to do it?

Pickle doesn't work because my data is too long and everything else I tried fails as well... I'm trying to send a frame over a socket from my client to my server.

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
ella
  • 11
  • 1
  • 2
    Does this answer your question? [Convert byte array back to numpy array](https://stackoverflow.com/questions/53376786/convert-byte-array-back-to-numpy-array) – SuperStormer Oct 23 '21 at 18:09

1 Answers1

2

Try this: x = np.frombuffer(n, dtype=i.dtype)

krmogi
  • 2,588
  • 1
  • 10
  • 26