What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-19 17:53:12
normalize a group in countplot
import numpy as np import pandas as pd import seaborn as sns sns.set(color_codes=True) df = sns.load_dataset('titanic') df.head() x,y = 'class', 'survived' (df .groupby(x)[y] .value_counts(normalize=True) .mul(100) .rename('percent') .reset_index() .pi... Add solution -
Other 2021-10-18 18:40:12
matplotlib pie chart label order
import matplotlib.pyplot as plt import pandas as pd #corresponding color-label pairs colors = ['#99f3bd', '#fbaccc', '#a8df65', '#ff7b54'] labels = ["Yes", "Sometimes", "Most of the times", "No"] #... Add solution