Answers for "pandas pairplot"

1

how to make a pairs plot with pandas

import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline

from sklearn import datasets

iris_dataset = datasets.load_iris()
X = iris_dataset.data
Y = iris_dataset.target

iris_dataframe = pd.DataFrame(X, columns=iris_dataset.feature_names)

# Create a scatter matrix from the dataframe, color by y_train
grr = pd.plotting.scatter_matrix(iris_dataframe, c=Y, figsize=(15, 15), marker='o',
                                 hist_kwds={'bins': 20}, s=60, alpha=.8)
Posted by: Guest on October-22-2020
3

seaborn pairplot

>>> import seaborn as sns; sns.set(style="ticks", color_codes=True)
>>> iris = sns.load_dataset("iris")
>>> g = sns.pairplot(iris)
Posted by: Guest on May-17-2020
0

pairplot with selected field

pp = sns.pairplot(data=data,
                  x_vars=['age'],
                  y_vars=['weight', 'height', 'happiness'])
Posted by: Guest on August-13-2020

Browse Popular Code Answers by Language