import numpy as np
# Get pivit table with statistic and fill missing values
df.pivot_table(values = "weekly_sales", index = "type", aggfunc = np.sum, fill_value = 0)
# Get pivit table with multiple statistics and fill missing values
df.pivot_table(values = "weekly_sales", index = "type", aggfunc = [np.sum, np.min, np.max], fill_value = 0)
# Get pivit table with multiple statistics and variables and fill missing values
df.pivot_table(values = "weekly_sales", index = "type", aggfunc = [np.sum, np.min, np.max], columns = "store", fill_value = 0)
# Get the sum of all rows and columns in pivot table
df.pivot_table(values = "weekly_sales", index = "type", aggfunc = [np.sum, np.min, np.max], columns = "store", fill_value = 0, margins = True)
# Display DataFrame
print(df)