I am trying to build a network where nodes have different color based on which list they belong to. At the moment there is only one list, list1, where elements found there are blue and other are green.
df['color'] = np.where(df.Var.isin(list1), "blue", "orange")
However I have another list, list2, which is important too, and I would like to distinguish also its elements with a colour (red), while the others keep the orange color. Summarising, what I would like to have is:
- elements in list 1 in blue
- elements in list 2 in red
- remaining elements in orange.
How can I change my code accordingly?