import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
import warnings
warnings.filterwarnings('ignore')
''' reading dataset '''
df = pd.read_excel('Wine_Production_by_country.xlsx')
''' displaying first five rows of data '''
df.head()
''' shape of data '''
df.shape
''' checking null values '''
df.isnull().sum()
''' info of data '''
df.info()
''' column nmaes '''
df.columns
''' value couns of country '''
plt.figure(figsize=(10, 5))
sns.barplot(df['Country'].value_counts(), df['Country'].value_counts().index);
plt.ylabel('Counry', fontsize=15);
plt.xlabel('count', fontsize=15);
''' converting year column into date time '''
df.Year = pd.to_datetime(df['Year'])
''' histogra plot '''
for feature in ['Year', 'Wine production in mhl']:
plt.figure(figsize=(10, 5))
sns.histplot(df[feature])
plt.title('Histogram plot of {}'.format(feature));
plt.figure(figsize=(10,8))
plt.xticks(rotation=90)
sns.barplot(df['Year'], df["Wine production in mhl"])
plt.xlabel('Year', fontsize=15)
plt.ylabel('Wine production in mhl', fontsize=15);
''' pie chart '''
df['Country'].value_counts().plot(kind='pie', figsize=(10,10), autopct="%1.2f%%")
plt.title("Country Pie");
df_h= df.loc[df["Wine production in mhl"] == 2.3]
df_h
df_h['Country'].value_counts().plot(kind='pie', figsize=(10,10), autopct="%1.2f%%")
plt.title("Country Pie");