I have a Dataframe with the column 'all_maxs'
that could have a list of different values.
c all_maxs
38 50804.6 [50883.3]
39 50743.9 [50883.3]
40 50649.9 [50883.3]
41 50508.3 [50883.3]
42 50577.6 [50883.3]
43 50703.0 [50883.3]
44 50793.7 [50883.3]
45 50647.8 [50883.3, 50813.1]
46 50732.8 [50883.3, 50813.1]
47 50673.2 [50883.3, 50813.1]
df.plot(y='c')
Current Result
I need to plot column 'c'
, and the values of column 'all_maxs'
that should be horizontal lines.
Expected Result
CodePudding user response:
- Verify the
'all_maxs'
values arelist
type. - Extract values from the lists and plot them as horizontal lines.
df = df.dropna()
if there are anyNaN