text_plain_output_1.png
import numpy as np # linear algebra

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

train_df = pd.read_csv('/kaggle/input/digit-recognizer/train.csv')
test_df = pd.read_csv('/kaggle/input/digit-recognizer/test.csv')
submission_df = pd.read_csv('/kaggle/input/digit-recognizer/sample_submission.csv')

train_df.shape

train_df.isna().sum().sum()

train_df.values

train_df.values[0]

train_df.values[:, :1]

train_df.values[:, 1:]

X = train_df.values[:, 1:]
y = train_df.values[:, :1]

X.shape

X_scale = X / 255.0

dim = int(np.sqrt(X_scale.shape[1]))
dim

N = X_scale.shape[0]
N

X_scale = X_scale.reshape((N, dim, dim, 1))

X_scale