You can use seaborn functions to plot graphs. Do dir(sns) to see all the plots. Here is your output in sns.scatterplot
. You can check the api docs here or example code with plots here
import seaborn as sns
import pandas as pd
df = pd.DataFrame([[ 1.82716998, -1.75449225],
[ 0.09258069, 0.16245259],
[ 1.09240926, 0.08617436]], columns=["x", "y"])
df["val"] = pd.Series([1, -1, 1]).apply(lambda x: "red" if x==1 else "blue")
sns.scatterplot(df["x"], df["y"], c=df["val"]).plot()
Gives
Is this the exact input output you wanted?
You can do it with pyplot, just importing seaborn changes pyplot color and plot scheme
import seaborn as sns
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
df = pd.DataFrame([[ 1.82716998, -1.75449225],
[ 0.09258069, 0.16245259],
[ 1.09240926, 0.08617436]], columns=["x", "y"])
df["val"] = pd.Series([1, -1, 1]).apply(lambda x: "red" if x==1 else "blue")
ax.scatter(x=df["x"], y=df["y"], c=df["val"])
plt.plot()
Here is a stackoverflow post of doing the same with sns.lmplot