Skip to content
Snippets Groups Projects
Commit ce8878e1 authored by Frisinghelli Daniel's avatar Frisinghelli Daniel
Browse files

Keep data type in array_replace.

parent eb5cae7e
No related branches found
No related tags found
No related merge requests found
......@@ -2219,11 +2219,11 @@ def array_replace(array, lookup):
"""
# create an index array to replace the values in the lookup table
indices = np.arange(np.int(lookup[:, 0].max()) + 1).astype(object)
indices = np.arange(np.int(lookup[:, 0].max()) + 1)
indices[lookup[:, 0].astype(np.int)] = lookup[:, 1]
# the array with the replaced values
return indices[array]
return indices[array].astype(array.dtype)
def dec2bin(number, nbits=8):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment