Date Light Time_difference Time_analysis
0 2018-11-17 00:00:00 5000.0 0 days 00:00:00 fine
1 2018-11-17 00:03:00 5000.0 0 days 00:03:00 fine
2 2018-11-17 00:06:00 5000.0 0 days 00:03:00 fine
3 2018-11-17 00:09:00 5000.0 0 days 00:03:00 fine
4 2018-11-17 00:12:00 5000.0 0 days 00:03:00 fine
482785 2021-02-22 23:59:56 634.4 0 days 00:00:00 fine
482786 2021-02-22 23:59:57 574.3 0 days 00:00:00 fine
482787 2021-02-22 23:59:58 598.9 0 days 00:00:00 fine
482788 2021-02-22 23:59:59 676.9 0 days 00:00:00 fine
482789 2021-02-23 00:00:00 5000.0 0 days 00:03:00 fine
I'm trying to use plotly to plot the dataframe, and I would like to plot a graph with my Date column on the x axis, and Time_difference on the y axis, with the Time_analysis column as the key/colour code. I tried the following code, but unfortunately, the format of the Time_difference column doesn’t come out the way I’d like it to, instead of '0 days 00:00:00', it reads '1 x 10 to the power of 15', for example.
fig = px.line(closer, x="Date", y="Time_difference", color="Time_analysis", labels={"Time_analysis": "fine", "Time_analysis": "gaps"}) fig.show()
Is there a way I can change the format of Time_difference so that it reads ‘0 days 00:00:00’, for example?
Thanks!