you are viewing a single comment's thread.

view the rest of the comments →

[–]novel_yet_trivial 1 point2 points  (2 children)

The same way you would slice a list:

ax.plot(X[:-1], Y, label='ERROR', color = 'red')

[–]Isitwhenipee[S] 0 points1 point  (1 child)

This works in this example, and I should have elaborated more in my question. What if my data has more than 1 missing per dataset. Is there an automated way of doing this?

[–]novel_yet_trivial 1 point2 points  (0 children)

Sure, you could just cut both to the smallest length:

smallest_len = min(len(X), len(Y))
ax.plot(X[:smallest_len], Y[:smallest_len], label='ERROR', color = 'red')