0
$\begingroup$

I have a time series data set with 3 parameters and 5 dates per time point which I would like to visualize. The problem is that the date time points (year) are not equal over the parameters:

ID       Year       A          B        C
ID1      1971       5          100      0.5
ID1      1972       6          102      0.4
ID1      1981       4          101      0.6
ID1      1991       5          103      0.5
ID1      1993       2          104      0.4
ID2      1971       4          100      0.9
ID2      1973       4          108      0.8
ID2      1981       5          109      0.7
ID2      1991       3          106      0.6
ID2      1993       3          103      0.5

What would be the best way to visualize such data?

$\endgroup$
2
  • $\begingroup$ It depends on what type of analysis you would like to perform and what question you want to a answer. Also, it's unclear to me what you mean by "5 dates per time point". Can you elaborate? $\endgroup$
    – Jonathan
    Sep 26, 2022 at 10:52
  • $\begingroup$ Thanks, I mean that each ID has 5 dates but they do not overlap. At the moment the only I idea I have is to show a heap map of all unique years. $\endgroup$
    – honeymoon
    Sep 26, 2022 at 12:09

1 Answer 1

1
$\begingroup$

Color line for each ID differently . The gaps in the data should show up in the graphs as-is .

import plotly.express as px
fig = px.line(df, x="Year", y="A", color='ID')
fig.show()
$\endgroup$
2
  • $\begingroup$ There are too many data points, just chaotic lines one over the other... $\endgroup$
    – honeymoon
    Sep 28, 2022 at 12:00
  • $\begingroup$ Try plotting in log scale to see if that helps. Pass log_y = True as an argument in px.line() $\endgroup$ Sep 28, 2022 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.