Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
earth_observation_public
PySegCNN
Commits
34e8bf02
Commit
34e8bf02
authored
Aug 16, 2021
by
Frisinghelli Daniel
Browse files
Array replace for negative values.
parent
3f9a7790
Changes
1
Hide whitespace changes
Inline
Side-by-side
pysegcnn/core/utils.py
View file @
34e8bf02
...
@@ -2523,7 +2523,8 @@ def array_replace(array, lookup):
...
@@ -2523,7 +2523,8 @@ def array_replace(array, lookup):
"""
"""
# create an index array to replace the values in the lookup table
# 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
]
indices
[
lookup
[:,
0
].
astype
(
np
.
int
)]
=
lookup
[:,
1
]
# the array with the replaced values
# the array with the replaced values
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment