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

import re

import re

df1 = pd.read_csv('../input/email-spam-dataset/completeSpamAssassin.csv')
df1 = df1[['Body', 'Label']]
df2 = pd.read_csv('../input/email-spam-dataset/enronSpamSubset.csv')
df2 = df2[['Body', 'Label']]
df3 = pd.read_csv('../input/email-spam-dataset/lingSpam.csv')
df3 = df3[['Body', 'Label']]
data = df1.append(df2).append(df3)
data = data.reset_index(drop=True)

data.dtypes

import re
data['extracted_body'] = data['Body'].apply(lambda x: re.sub('http\\S+', '', str(x)))

import re
data['extracted_body'] = data['extracted_body'].apply(lambda x: re.sub('\\W+', ' ', x))

data['extracted_body'][10].split()