Skip to content Skip to sidebar Skip to footer

Efficiently Plotting Multiple Columns In Pandas

I would like to know how to efficiently plot groups of multiple columns in a pandas dataframe. I have the following dataframe | a | b | c |...|trial1.1|trial1.2|...|trial1.

Solution 1:

How about first transverse the dataframe, then split the dataframe by trials, then plot.

# Transverse
data = pd.read_csv("data.txt").T

# Insert your code to remove irrelevant rows, like a, b, c in your example
#

# Group by the trial number (the first six characters) and plot
data.groupby(lambda x: x[:6], axis=0).plot()

Post a Comment for "Efficiently Plotting Multiple Columns In Pandas"