Reputation: 1703
How to I convert a uint8
created by numpy to a standard Python int
so that it can be serialized to json?
Upvotes: 3
Views: 7081
Reputation: 70317
Consider int
.
a = numpy.uint8(some_number)
b = int(a)
print(type(b)) # <class 'int'>
Upvotes: 5