I am trying to make a pairplot using
sns, but for some reason, it refuses to plot the first one. What may cause this issue?
Here is the fully working code:
import pandas as pd import seaborn as sns import matplotlib.pyplot as plt df = pd.read_csv("http://web.stanford.edu/~oleg2/hse/auto/Auto.csv").dropna() med = df.mpg.median() df['mpg01'] = [1 if i > med else 0 for i in df.mpg] sub = df.drop(columns=['name']) sns.pairplot(data=sub, x_vars=sub.columns, y_vars=['mpg01']) plt.show()
Source: Python Questions