text_html_output_1.png
from sklearn.preprocessing import LabelEncoder

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

train_df = pd.read_csv('../input/matchesheader.csv')

names_col = list(train_df.columns.values)
new_names_col = map(lambda name: name.strip(), names_col)
train_df.columns = new_names_col

list(train_df.columns.values)

train_df.isna().sum()

from sklearn.preprocessing import LabelEncoder
labelEncoder = LabelEncoder()
train_df.team_1_name = labelEncoder.fit_transform(train_df.team_1_name)
train_df.team_2_name = labelEncoder.fit_transform(train_df.team_2_name)
train_df.head()