I'm using folium to plot a map based on lat and lng. My dataframe is something like this, where every lat and lng as an attribute "Circuito":
Circuito Latitude Longitude
L2RC 41.36394 -8.550200
L21M 41.22638 -8.693360
LBXP 41.15796 -8.610030
L2RC 41.36394 -8.550200
LERM 41.23865 -8.531550
LCAN 41.14016 -8.634990
LARE 41.19195 -8.556460
LCAR 41.05805 -8.563920
LBXP 41.15786 -8.600700
LBAG 41.18931 -8.526040
I would like to plot the color of the markers based on the attribute "Circuito". But I have only found examples where there is a small number of different colors to plot, which is not the case. For now I have something like this:
for i in range(len(df)):
if df.loc[i,'Circuito']==L2RC
icon=folium.Icon(color='white')
l2rc_group.add_child(folium.Marker((df[i, 'Latitude'],df[i, 'Longitude']), icon=icon))
The problem with this solution is that I have to make an if condition for each possible "circuito" attribute (and there are a lot) and I have to write the color to plot. I was looking for a solution where this isn't needed but I don't know if it is possible.
Thank you!