Skip to content

Commit 6775c82

Browse files
committed
Add np.bool in json encoder
1 parent c2edf7d commit 6775c82

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

xobjects/hybrid_class.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ def default(self, obj):
8888
return obj.tolist()
8989
elif np.issubdtype(type(obj), np.integer):
9090
return int(obj)
91+
elif isinstance(obj, np.bool):
92+
return bool(obj)
9193
else:
9294
return json.JSONEncoder.default(self, obj)
9395

0 commit comments

Comments
 (0)