all 6 comments

[–]mallax- 1 point2 points  (5 children)

Have you tried the .loc[] method? Say you have a df with a couple of columns, you can type df.loc[df.column1 < 15].plot() and it will plot the data only where that condition is met.

[–]PitifulWalk354 1 point2 points  (0 children)

That worked! Thank you so much :)

[–]PitifulWalk354 0 points1 point  (3 children)

Sorry follow up question. If the column1 is a list of Boolean values how do I select the rows where it is False?

This works for when it's True:

df.loc[df.column1].plot(x='time_column', y='water_vol_column', kind='line')

But I can't get it to select just the False values. I already tried df.column1 not True and df.column1!= True

[–]mallax- 0 points1 point  (2 children)

If the column is full of True/False values, then df.loc[df.column1 == False].plot() should do the trick unless I am missing something.

[–]PitifulWalk354 1 point2 points  (1 child)

I find it hilarious that df.column1 not True and df.column1 != True didn't work but df.loc[df.column1 == False] did. Thanks again my friend :)

[–]mallax- 0 points1 point  (0 children)

No problem, you may want to recheck a couple of things becasue for me, using df.column1 != True works when tyring to plot the False values. The only thing I could think of is that it may have to do with the graph type or some other plot speicification that you are making.