ml4a / ml4a-ofx

A collection of openFrameworks apps for working with machine learning
http://ml4a.github.io
1.22k stars 279 forks source link

cast numpy.float32 to float before serializing data with simplejson #29

Closed fchtngr closed 6 years ago

fchtngr commented 6 years ago

Passing a <class 'numpy.float32'> to simplejson.dump results in a TypeError: 0.61730546 is not JSON serializable

This fix casts the numpy.float32 to a python float which can be serialized.

genekogan commented 6 years ago

thanks!