Skip to content

Commit

Permalink
add help remove the exclude list indice from profile list indice
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacques Grelet committed Apr 1, 2021
1 parent 0a9ac31 commit c72b5ff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ def section(self, start, end, xaxis, yscale, exclude,
except:
sys.exit("invalid --list {}-{}, max value must be <= {}".format(start, end,
profiles[-1]))
# remove the exclude list indice from profile list indice
# https://www.geeksforgeeks.org/python-indices-list-of-matching-element-from-other-list/?ref=rp
res = [i for i, val in enumerate(list_profiles) if val in list_exclude]
list_profiles = np.delete(list_profiles, res)
#print(list_profiles)
Expand Down

0 comments on commit c72b5ff

Please sign in to comment.