I have an array
devID = [A, B, C, ..., AP, BP, CP, ...]
device = [A, B, C, ..., A, B, C, ...]
which are related to each other.
I want to create another array color
which has the same value for those places where device
has the same value, i.e.:
color = [ 'r', 'g', 'b', ..., 'r', 'g', 'b', ...]
Since I want to automatize this for plotting different curves associated to devID
, which has a length of around 100, I would like the colors to be assigned from, say, a colormap.
So far I've tried different combinations of numpy.unique
and numpy.where
without any succcess...