def default(self, obj):
if isinstance(obj, np.integer):
return int(obj)
elif isinstance(obj, np.floating):
return float(obj)
elif isinstance(obj, np.ndarray):
return obj.tolist()
else:
return super(MsgEncoder, self).default(obj)
#Normalized versions with summary stats to be sent to the cloud
评论列表
文章目录