I make a web app, the server side is running Python and processes data with numpy. I want to display charts from the numpy data on the browser.
On the server I encode a list of numpy arrays with msgpack_numpy:
import numpy
import msgpack
import msgpack_numpy as m
m.patch()
arr1 = numpy.array([1,2]) # just an example
encoded = msgpack.packb([arr1], use_bin_type=True) # I want to transfer a list of np arrays
Then, I pass the encoded bytes through a SignalR websocket, on the web browser side I get a Uint8Array which looks OK.
Now for deserializing:
import { decode } from '@msgpack/msgpack';
const msgpack = { decode };
var data = decode(buffer);
Before I can continue with transforming the output to a numpy-like array I get the following error message:
The type of key must be string or number but object
msgpack.decode, from the msgpack-lite package whereas I use the classic msgpack lib... Will do more checks