Skip to content

Commit d136423

Browse files
committed
Encode numpy datatypes in dataframe to JSON
1 parent f9315e4 commit d136423

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

vecorel_cli/encoding/geojson.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,5 +336,9 @@ def default(self, obj):
336336
return obj.tolist()
337337
elif isinstance(obj, set):
338338
return list(obj)
339+
elif isinstance(obj, np.integer):
340+
return int(obj)
341+
elif isinstance(obj, np.bool):
342+
return bool(obj)
339343
else:
340344
return super().default(obj)

0 commit comments

Comments
 (0)