I have a python DataFrame from Pandas
waitEvent instance snapDate gc cr block 3-way gc current block 3-way log file sync
Every time I construct this DataFrame, the number and name of columns after the snapDate are different.
I would need to construct a new DataFrame by selecting snapDate as the indexcolumn but the remaining columns should be dynamically selected for plotting any ideas. How can I achieve this?
for the df above, I should always select the snapDate column and all the columns
after the snapDate column
The number and name of the columns after the snapDate column will vary.
My objective is to do
df[snapDate,col1,col2,col3].plot()
df[snapDate,col7,col8].plot()
..
I want to create a plot from the DataFrame by always picking the SnapDate column and the remaining columns which depending on the DataFrame could be 2 or 3 or 4 etc.
df.iloc[:,2:]