<jupyter_start><jupyter_text>seaborn facetgrid<jupyter_code>import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sb
np.random.seed(sum(map(ord, "axis_grids")))
%matplotlib inline
tips = sb.load_dataset('tips')
tips.head()
g = sb.FacetGrid(tips,col='time')
g = sb.FacetGrid(tips,col='time')
g.map(plt.hist,"tip")
# 以sex为分组一组，划分出male、female两类
# 再以smoker进行划分yes 或 no
# 最终呈现 yes中total_bill与tip的关系 no中total_bill与tip的关系 
g = sb.FacetGrid(tips,col='sex',hue="smoker")
g.map(plt.scatter,"total_bill","tip")
g.add_legend()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14680483592400692, 'fraction_numerical': 0.0, 'mean_word_length': 8.508196721311476, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '432292', 'license': 'Apache-2.0', 'n_tokens_mistral': 274, 'n_tokens_neox': 267, 'n_words': 40, 'path': 'seaborn/seaborn facetgrid.ipynb', 'repo_name': '2801616735/python_ml', 'size': '579'}