python - Converting a numpy string array to integers in base-16 -
i looking way convert array of strings in numpy integers represent in hexadecimal. in other words, array version of:
int("f040", 16)
i can convert string array integers base-10 calling arr.astype(numpy.int32), can't see obvious way convert them base-16. know of way this?
ar = ['f040', 'deadbeaf'] int_array = [int(a, 16) in ar] print int_array
output:
[61504, 3735928495l]
Comments
Post a Comment