text_plain_output_1.png image_output_1.png
import matplotlib.pyplot as plt

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import seaborn as sns

prices = pd.read_csv('../input/avocado/avocado.csv', index_col=0)
prices_2018 = prices.query("Date >= '2018-01-01' & Date <= '2018-12-31'")
prices_2018

grouped_2018 = prices_2018.groupby('region')['AveragePrice'].mean()
grouped_2018 = grouped_2018.reset_index()
grouped_2018

plt.figure(figsize=(14, 12))
sns.barplot(x=grouped_2018.AveragePrice, y=grouped_2018['region'])
plt.xlabel('')
plt.title('Average Price for Avocado, by Regions')