text_plain_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

df = pd.read_csv('../input/goodreadsbooks/books.csv', error_bad_lines=False)

df.rename(columns={'  num_pages': 'num_pages'}, inplace=True)
df.columns

df['publication_year'] = [i.split('/')[2] for i in df['publication_date']]
df['decade'] = [int(i) // 10 * 10 for i in df['publication_year']]
df_lang_year = df.groupby(['decade', 'language_code']).count().reset_index()
df_lang_year

plt.figure(figsize=(20,10))
plt.xlabel('Year')
plt.ylabel('Number of Books')
    
ax1 = sns.lineplot(x="decade", y="bookID",
             hue="language_code", #style="event",
             data=df_lang_year)

ax1.set_ylabel('Number of Books')
ax1.set_xlabel('Decade')

x = df.groupby('language_code')['bookID'].count().reset_index().sort_values(by='bookID', ascending=False)
plt.figure(figsize=(15, 10))
ax1 = sns.barplot(x='language_code', y='bookID', data=x)
ax1.set_xlabel('Language Code')
ax1.set_ylabel('Number of Books')
ax1.set_yscale('log')