I have a dataframe where one of the columns is a 16 element vector (stored as a list).
In the past, I have found seaborn's lineplot
highly useful for regression analysis on a scalar column. The vector column has me in a bind.
Consider a seaborn sample program:
import seaborn as sns
sns.set_theme(style="darkgrid")
# Load an example dataset with long-form data
fmri = sns.load_dataset("fmri")
# Plot the responses for different events and regions
sns.lineplot(x="timepoint", y="signal",
hue="region", style="event",
data=fmri)
it yields a figure, such as this
If I add another column signal2 to fmri
:
fmri['signal2'] = '[1,2,3,4,5,6]'
(this is for representational purposes only)
In the dataset I have, there is a list of 16 floats in a column of the dataset. What I want to do is look at lineplot for:
sns.lineplot(x="<length of vector>", y="signal2",
hue="region", style="event",
data=fmri)
Basically, look at variations in the vector for different subsections of the dataset.