This is my input dataframe:
labels percentile_5 percentile_25 median percentile_75 percentile_98
0 0 21 25 27 30 34
1 1 49 52 56 61 71
2 2 34 36 39 43 48
I have tried transform using the below code:
t = df.T.reset_index()
t.columns = t.iloc[0]
t = t.iloc[1:]
Output:
labels 0 1 2
1 percentile_5 21 49 34
2 percentile_25 25 52 36
3 median 27 56 39
4 percentile_75 30 61 43
5 percentile_98 34 71 48
Using this I can create line chart with only one line.
fig = px.line(t, x="labels", y=0)
fig.show()
I am trying to plot like this, x-axis = labels, legend = 0,1,2
What are the changes I need to do in dataframe or is there any easy way to plot using the first dataframe?

