I have the following df :
df1 :
index Event1 Event2 Event3 Event4 Event5 Event6
2000-01-01 1 1 1 1 1 1
2000-01-02 nan nan nan nan nan nan
2000-01-03 nan nan nan nan nan nan
2000-01-04 nan nan nan nan nan nan
2000-01-05 nan nan nan nan nan nan
(...)
2000-02-03 1 nan 1 nan 1 1
2000-02-04 nan nan nan nan nan nan
2000-02-05 nan nan nan nan nan nan
2000-02-06 nan nan nan nan nan nan
2000-02-07 nan nan nan nan nan nan
(...)
2020-08-03 nan nan nan nan nan nan
2020-08-05 nan nan nan nan nan nan
2020-08-07 nan nan nan nan nan nan
2020-08-10 nan 1 nan 1 nan nan
2020-08-13 nan nan nan nan nan nan
This df represents if certain event happened in the date assigned.
If there is an 1 as value in the first column of the df, the event1 happened in that date, and so on.
What I need is to plot this, like a timeline, showing when the events happened. I tried building a scatterplot, showing the values, but it was really off. Something like this would be nice :
If you guys could point me in any direction...
I looked up in the following links, but couldn't find a way of doing it:
Observations :
- the DataFrame itself is big, containing 20 years of Data. I believe I will not be able to plot in a single image with decent resolution, but I can break the DataFrame in smaller ones and then plot individually.
- I don't need every date to the in my y axis, but the gap can't be too wide as well.
- There is at least a month separating one event from another, in each column.
- Not necessarily, the events happened in the beginning of the month.
- The events happen in the same date, but some may not have happened.