text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

train = pd.read_csv('/kaggle/input/nlp-getting-started/train.csv')
test = pd.read_csv('/kaggle/input/nlp-getting-started/test.csv')

train = train.drop_duplicates().reset_index(drop=True)

train.target.value_counts()

train.isnull().sum()

test.isnull().sum()

dist = train[train.target==1].keyword.value_counts().head()
#dist
plt.figure(figsize=(9,6))
sns.barplot(dist,dist.index)
plt.show()

nondist = train[train.target==0].keyword.value_counts().head()
#nondist
plt.figure(figsize=(9,6))
sns.barplot(nondist,nondist.index)
plt.show()

distribution_dist = train.groupby('keyword').mean()['target'].sort_values(ascending=False).head(10)

distribution_nondist = train.groupby('keyword').mean()['target'].sort_values().head(10)

print(train.location.nunique(), test.location.nunique())