text_plain_output_1.png
from sklearn.preprocessing import LabelEncoder

import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

df_train = pd.read_csv('/kaggle/input/loan-data-set/loan_train.csv')
df_test = pd.read_csv('/kaggle/input/loan-data-set/loan_test.csv')

df_train.isna().sum()

df_train.isna().sum()

columns_list = list(df_train.columns)
for i in range(len(columns_list)):
    plt.xticks(rotation=45)
plt.tight_layout()

le = LabelEncoder()
str_col = df_train.select_dtypes(include='object').columns
for c in str_col:
    df_train[c] = le.fit_transform(df_train[c])

df_train.head()