Skip to content
Advertisement

TypeError: Object of type mappingproxy is not JSON serializable

I am having an issue when trying to convert a class object to JSON format. Actually, I have an ECG class object and my expectation is to convert that object to a string in JSON format.

Ex: { “Source”: “MIT”, “FileName”: “100”, “Channel”: 2, “Record”: 11520000, “Time”: 1800, “SampleRate”: 500 }

ECGModel.py

JavaScript

Main.py

JavaScript

Processor.py

JavaScript

Log:

JavaScript

Advertisement

Answer

I tried to guess what you are trying to achieve. See if the following codes work for you

ECGModel.py

JavaScript

Processor.py

JavaScript

Main.py: You may replace print with your st.write

JavaScript

Output

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement