In the following example, with the plotly.express line function, is there a siple way to color the lines according to the row "Continent" ? And to have the countries names as hover names?
Thank you for your answers.
import numpy as np
import plotly.express as px
a=['Afghanistan','Albania','Algeria','Andorra','Angola','Antigua','Argentina','Armenia']
b=np.random.random((100,8))
c=['Asia','Europe','Africa','Europe','Africa','America','America','Asia']
df=pd.DataFrame(columns=a, data=b)
df.loc['Continent'] = c
fig = px.line(df, x=df.index, y=df.columns)
fig.show()
