<jupyter_start><jupyter_text>Charts<jupyter_code>import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
house_prices = pd.read_csv("data/house-prices.csv")<jupyter_output><empty_output><jupyter_text>Histogram  Plotting the series<jupyter_code>sns.displot(house_prices["SalePrice"])
plt.title("Sale Price Distribution")
plt.xlabel("Sale Price")
plt.ylabel("Houses Sold")
plt.show()<jupyter_output><empty_output><jupyter_text>Styled<jupyter_code>sns.set_style("white")
sns.set_color_codes(palette='deep')
f, ax = plt.subplots(figsize=(8, 7))
sns.histplot(house_prices['SalePrice'], color="b", kde=True)
ax.xaxis.grid(False)
ax.set(ylabel="Houses Sold")
ax.set(xlabel="Sale Price")
ax.set(title="Sale Price Distribution")
sns.despine(trim=True, left=True)
plt.show()<jupyter_output><empty_output><jupyter_text>Plotting using the data frame<jupyter_code>sns.displot(house_prices, x="SalePrice")
plt.title("Sale Price Distribution")
plt.xlabel("Sale Price")
plt.ylabel("Houses Sold")
plt.show()<jupyter_output><empty_output><jupyter_text>Adjusting the figure size<jupyter_code>fig, ax = plt.subplots(figsize=(3, 2))
# Note that displot doesn't accept an `ax` parameter 
# which is why we're using histplot here
sns.histplot(house_prices, x="SalePrice", ax=ax)
plt.show()<jupyter_output><empty_output><jupyter_text>Scatter Plot  Seaborn<jupyter_code>sns.scatterplot(data=house_prices, x="TotalBsmtSF", y="SalePrice")
plt.show()<jupyter_output><empty_output><jupyter_text>Pyplot<jupyter_code>house_prices.plot.scatter(x="TotalBsmtSF", y="SalePrice", c="DarkBlue")
plt.show()<jupyter_output><empty_output><jupyter_text>Box Plot<jupyter_code>sns.boxplot(data=house_prices, x="OverallQual", y="SalePrice")
plt.show()<jupyter_output><empty_output><jupyter_text>Bar plot"Show point estimates and confidence intervals as rectangular bars."<jupyter_code>sns.barplot(data=house_prices, x="MoSold", y="SalePrice")
plt.title("Average Sale Price by Month")
plt.ylabel("Average Sale Price")
plt.xlabel("Month Sold")
plt.show()
percent_missing = house_prices.isnull().sum() / house_prices.shape[0]
features_with_missing_values = percent_missing[percent_missing.gt(0)].mul(100).sort_values(ascending=False)
sns.barplot(x=features_with_missing_values.index, y=features_with_missing_values)
plt.xticks(rotation=90)
plt.ylabel("Percent of Values Missing")
plt.show()<jupyter_output><empty_output><jupyter_text>Correlation HeatmapSee Correlation notebook for more detailed examples.<jupyter_code>fig, ax = plt.subplots(figsize=(10, 8))
sns.heatmap(house_prices.corr());
plt.show()<jupyter_output><empty_output><jupyter_text>Hiding a legend<jupyter_code># ## Hiding a legend

# ```python
# plt.legend('', frameon=False)
# ```

# or

# ```python
# ax.get_legend().remove()
# ```

# or

# ```python
# df.plot(legend=False)
# ```<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15233415233415235, 'fraction_numerical': 0.004914004914004914, 'mean_word_length': 10.4, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, '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': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '296195', 'license': 'MIT', 'n_tokens_mistral': 1138, 'n_tokens_neox': 1096, 'n_words': 156, 'path': 'Charts.ipynb', 'repo_name': 'dbl007/python-cheat-sheet', 'size': '2849'}