value counts for a single and tow categorical variable
# coding=utf-8
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
pd.set_option('display.max_columns', None)
pd.set_option('display.width', None)
plt.rcParams['font.sans-serif']=['SimHei'] #显示中文标签
plt.rcParams['font.serif'] = ['KaiTi']
plt.rcParams['axes.unicode_minus'] = False
# import seaborn as sns
sns.set(style="darkgrid")
titanic = sns.load_dataset("titanic")
print(titanic.head())
fig, axes =plt.subplots(1,2)
sns.countplot(x="class", hue="who", data=titanic,ax=axes[0])
sns.countplot(x="class", data=titanic,ax=axes[1])
plt.show()