<jupyter_start><jupyter_text>seaborn catplot demo<jupyter_code># ref: https://www.geeksforgeeks.org/python-seaborn-catplot/<jupyter_output><empty_output><jupyter_text>1. load data as pd.dataframe<jupyter_code>import numpy as np
import pandas as pd
from sklearn.datasets import load_iris

iris = load_iris()

# np.c_ is the numpy concatenate function
# which is used to concat iris['data'] and iris['target'] arrays 
# for pandas column argument: concat iris['feature_names'] list
# and string list (in this case one string); you can make this anything you'd like..  
# the original dataset would probably call this ['Species']
data1 = pd.DataFrame(data= np.c_[iris['data'], iris['target']],
                     columns= iris['feature_names'] + ['target'])
data1
import seaborn as sns 
  
g = sns.catplot(x="sepal length (cm)", y="sepal width (cm)", 
                hue="target", 
                data=data1)
g.fig.set_figwidth(15)
g.fig.set_figheight(5)
import seaborn as sns 
g = sns.catplot(x="sepal length (cm)", 
                kind="count", 
                data=data1) 
g.fig.set_figwidth(15)
g.fig.set_figheight(5)
g = sns.catplot(x="sepal length (cm)", y="sepal width (cm)", 
            data=data1, 
            kind='box'); 
g.fig.set_figwidth(15)
g.fig.set_figheight(5)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13252094440213252, 'fraction_numerical': 0.011424219345011425, 'mean_word_length': 3.6595744680851063, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '547553', 'license': 'MIT', 'n_tokens_mistral': 482, 'n_tokens_neox': 460, 'n_words': 113, 'path': 'seaborn/seaborn_catplot.ipynb', 'repo_name': 'ybdesire/machinelearning', 'size': '1313'}