I must say right away that I am new to python and have only just come across data analytics in it.
Working with Pandas and Plotly, from the csv file, I take the data to create a dataframe (next – DF) in Pandas, then using loc[::10] I take every 10 lines. The DF file itself consists of many thousands of rows and dozens of columns, but I’m only interested in 2 columns: time and data. Then I pass these two columns to Plotly: “fig.add_trace(go.Scatter(x = DF[column Time], y = DF[column Power], mode=’line+markers’))”, where x is time, y is data. The values in data can be either negative, zero, or positive.
Question: how can I display information on the Plotly chart about how long the negative and zero values lasted in total?
Let’s say:
0 00:00:01 5
1 00:00:02 10
3 00:00:03 9
4 00:00:04 -0.5
5 00:00:05 -0.4
6 00:00:06 -0.3
7 00:00:07 0.0 – 4 sec duration
8 00:00:08 5
9 00:00:09 10
10 00:00:10 11
This needs to be shown on the graph. There can be a lot of such values.
I will be very grateful to you, English is not my native language.
I haven’t tried anything, I have no idea how it could work. Perhaps other libraries are needed.
Ganzert is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.