text_plain_output_5.png application_vnd.jupyter.stderr_output_2.png application_vnd.jupyter.stderr_output_4.png text_plain_output_3.png text_plain_output_1.png
import matplotlib as plt

import matplotlib.pyplot as plt

import pandas as pd

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

import seaborn as sns

import seaborn as sns

df = pd.read_csv('../input/nlp-getting-started/train.csv')
df_test = pd.read_csv('../input/nlp-getting-started/test.csv')
df.dropna(subset=['text'], inplace=True)
X = df['text']
y = df['target']
X_test = df_test['text']

df['num_words'] = df['text'].apply(lambda x: len(x.split()))
plt.figure(figsize=(20, 6))
sns.histplot(df['num_words'], bins=range(1, 50, 2), palette='Set1', alpha=0.8)
plt.title('Distribution of the word count')