text_plain_output_1.png
from sklearn.preprocessing import LabelEncoder

import pandas as pd

dftrain = pd.read_csv('../input/tabular-playground-series-aug-2022/train.csv')

dftest = pd.read_csv('../input/tabular-playground-series-aug-2022/test.csv')

dftotal = dftrain.append(dftest)

dftotal.reset_index(inplace=True)

dftotal.columns

dftotal.isnull().sum()

dftotal.isnull().sum()

dftotal = dftotal[dftotal['loading'].notna()]

from sklearn.preprocessing import LabelEncoder
labelencoder = LabelEncoder()
dftotal['product_code'] = labelencoder.fit_transform(dftotal['product_code'])
dftotal['product_code'].value_counts()