Commit 221eb041 authored by Frisinghelli Daniel's avatar Frisinghelli Daniel
Browse files

Array replace for negative values.

parent 34e8bf02
......@@ -2523,8 +2523,7 @@ def array_replace(array, lookup):
"""
# create an index array to replace the values in the lookup table
indices = np.arange(np.int(lookup[:, 0].min()),
np.int(lookup[:, 0].max()) + 1)
indices = np.arange(np.int(lookup[:, 0].max()) + 1)
indices[lookup[:, 0].astype(np.int)] = lookup[:, 1]
# the array with the replaced values
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment