Face Cream, Face Wash, and Toothpaste Sales: A Box Plot Analysis
import matplotlib.pyplot as plt import pandas as pd
data = {'month_number': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], 'facecream': [2500, 2630, 2140, 3400, 3600, 2760, 2980, 3700, 3540, 1990, 2340, 2900], 'facewash': [1500, 1200, 1340, 1130, 1740, 1555, 1120, 1400, 1780, 1890, 2100, 1760], 'toothpaste': [5200, 5100, 4550, 5870, 4560, 4890, 4780, 5860, 6100, 8300, 7300, 7400]}
df = pd.DataFrame(data)
plt.figure(figsize=(10, 6)) plt.boxplot([df['facecream'], df['facewash'], df['toothpaste']], labels=['Face Cream', 'Face Wash', 'Toothpaste']) plt.title('Sales of Face Cream, Face Wash and Toothpaste') plt.ylabel('Sales') plt.show()
原文地址: http://www.cveoy.top/t/topic/bHjr 著作权归作者所有。请勿转载和采集!