Commit 34e8bf02 authored by Frisinghelli Daniel's avatar Frisinghelli Daniel
Browse files

Array replace for negative values.

parent 3f9a7790
......@@ -2523,7 +2523,8 @@ 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)
indices = np.arange(np.int(lookup[:, 0].min()),
np.int(lookup[:, 0].max()) + 1)
indices[lookup[:, 0].astype(np.int)] = lookup[:, 1]
# the array with the replaced values
......
Supports Markdown
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