Created
July 16, 2019 17:02
-
-
Save kyrcha/bb7bbd44d90d4af346b233adf1a16102 to your computer and use it in GitHub Desktop.
Converting a pandas dataframe with each row being a vector image to a 4D tensor for CNN use in Keras
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Transforming a 60000x784 dataframe to a 60000x28x28x1 4D tensor for Keras modelling | |
| train_img = X_train.values.reshape(X_train.shape[0], 28, 28, 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment