text_plain_output_1.png
import numpy as np

import pandas as pd

import numpy as np
import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
train = pd.read_csv('../input/train.csv')

train.toxic.value_counts()

pd.crosstab(train.toxic, train.severe_toxic)

pd.crosstab(train.toxic, [train.obscene, train.threat, train.insult, train.identity_hate])

pd.crosstab(train.severe_toxic, [train.obscene, train.threat, train.insult, train.identity_hate])

train.iloc[:, 2:8].corr()

train[train.comment_text.isnull()]

train[train.comment_text == '']

train['comment_length'] = train.comment_text.str.len()

train = train.sort_values(by='comment_length', ascending=False)
pd.set_option('display.max_colwidth', -1)

one_percent = int(np.ceil(train.shape[0] / 100))
train_sub = train.iloc[0:one_percent, :]
train_sub.toxic.value_counts()