Home > Back-end >  Seaborn, ValueError: Could not interpret value for parameter
Seaborn, ValueError: Could not interpret value for parameter

Time:12-22

I am trying to draw a sctterplot using seaborn, here is my code:

df1 = pd.read_csv("./data/pca_denoied.csv")
x, y, z = df1.columns
sns.scatterplot(df1, x=x, y=y, hue=z)
plt.show()

But it seems that this code doesn't work well which results in this error:

ValueError: Could not interpret value `b` for parameter `y`

And this is the head of my .csv file:

a         b  Label
0 -4.880576  1.259477      0
1 -2.198623  2.713788      0
2 -0.767380  2.769895      0
3 -1.036379  3.014535      0
4 -1.850189  2.202340      0
Backend Qt5Agg is interactive backend. Turning interactive mode on.

What am I doing wrong? I would appreciate it if anyone could help me out this problem.

CodePudding user response:

It worked fine with me, try to clean your data, I see an extra column of zeros that I guess it shouldn't be there. seaborn test

CodePudding user response:

Try this:

sns.scatterplot(x, y, hue=z, data=df1)
  • Related