<jupyter_start><jupyter_text>Seaborn Styles<jupyter_code>sb.set() #set the current default style of seaborn
sinplot()
plt.show()
sb.set_style("whitegrid")
sinplot()
plt.show()
sb.set_style("white")
sinplot()
plt.show()
sinplot()
sb.despine()
plt.show()<jupyter_output><empty_output><jupyter_text>Color palettes in Seaborn<jupyter_code>#Qualitative
current_palette = sb.color_palette()
sb.palplot(current_palette)
plt.show()
help(sb.color_palette)
#Sequential
sb.palplot(sb.color_palette("Greens"))
plt.show()
#Sequential
sb.palplot(sb.color_palette("Reds"))
plt.show()
#Diverging
sb.palplot(sb.color_palette("BrBG", 8))
plt.show()
sb.palplot(sb.color_palette("RdBu", 6))
plt.show()
#Setting a selected palette for a graph
sb.set_palette('Reds')
sinplot()
plt.show()
sb.set_palette("winter")
sinplot()
plt.show()<jupyter_output><empty_output><jupyter_text>Graphs in Seaborn<jupyter_code>#Load a dataset
dataset = sb.load_dataset('iris')
print(dataset.shape)
dataset.head()
import pandas as pd
pd.unique(dataset['species'])
#Distribution of the data - continuous variable
sb.distplot(dataset['petal_length'])
sb.distplot(dataset['petal_length'],hist=False) #Kernel Density Estimator(KDE)
sb.distplot(dataset['petal_length'],kde=False)
#Scatter Plot
sb.scatterplot(dataset['petal_length'],dataset['petal_width'])
#Pair Plots - Comparing multiple variables
sb.pairplot(dataset,hue = 'species',diag_kind = "kde",kind = "scatter",palette = "husl")
sb.boxplot(data = dataset, x = 'species', y = 'sepal_length', palette = 'husl')
sb.swarmplot(data = dataset, x = 'species', y = 'sepal_length', palette = 'husl')
dataset = sb.load_dataset('titanic')
dataset.shape
dataset.head()
sb.distplot(dataset['age'])
sb.distplot(dataset['fare'])
sb.countplot(dataset['survived'], palette = 'winter')
sb.countplot(dataset['sex'], palette = 'autumn')
sb.countplot(dataset['sex'], hue=dataset['survived'], palette = 'spring')
sb.countplot(dataset['pclass'], hue=dataset['survived'], palette = 'spring')
sb.boxplot(data = dataset, x = 'pclass', y = 'age', palette = 'husl')
sb.scatterplot(dataset['age'],dataset['fare'])
dataset.info()
import pandas as pd
pd.isnull(dataset)
sb.heatmap(pd.isnull(dataset))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17314647377938516, 'fraction_numerical': 0.0009041591320072332, 'mean_word_length': 8.835555555555555, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '184837', 'license': 'MIT', 'n_tokens_mistral': 844, 'n_tokens_neox': 810, 'n_words': 144, 'path': 'Seaborn Graphs.ipynb', 'repo_name': 'swaruptripathy/DataScience-Python', 'size': '2212'}