text_plain_output_1.png image_output_1.png
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

messages = pd.read_csv('../input/spam.csv', encoding='latin-1')

messages.drop(['Unnamed: 2', 'Unnamed: 3', 'Unnamed: 4'], axis=1, inplace=True)

messages = messages.rename(columns={'v1': 'class', 'v2': 'text'})

f, ax = plt.subplots(figsize=(12, 8))
sns.stripplot(x="class", y="words_len", data=messages)
plt.title('Number of words per class')

f, ax = plt.subplots(figsize=(12, 8))
sns.stripplot(x='class', y='char_len', data=messages)
plt.title('Number of characters per class')