📌  相关文章
📜  TypeError:uint32 类型的对象不是 JSON 可序列化的 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:19.484000             🧑  作者: Mango

代码示例1
# It seems like there may be a issue to dump numpy.int64 into json string in Python 3.
# the generic solution: 

def convert(o):
    if isinstance(o, np.generic): return o.item()  
    raise TypeError

json.dumps({'value': numpy.int64(42)}, default=convert)