I want to load a mat-file in Python and convert it to a JSON format.
I can load it with loadmat
-command but I can not convert it to JSON with the json.dumps
command.
I create a Dash GUI. In this, I want to load a mat-file in a callback and save it global in a hidden DIV, so I don't have to load it new every time I need the mat-file data with loadmat which takes a lot of time. This is what i have tried:
import json
data = loadmat(path)
data_json = json.dumps(Datensatz)
The error is:
Object of type bytes is not JSON serializable