0

I have a dataframe like this.

df = pd.DataFrame(np.array([[1, 2, 3, 4], [4, 5, 6, 4], [7, 8, 9, 4]]),
                   columns=['NP_A', 'NP_B', 'NP_C', "OP_A"])

I would like to use sns.lineplot.

But instead of the name of the columns as 'hue' I would like to make a split of the names.

"NP", "A"
"NP", "B"
...

In order to have a legend that considers the two combinations.

0 Answers0