The code calculates the shape of the dataset, then reshapes it so that it has the same number of samples and rows as the input dataset.
Library: numpy
from sklearn import preprocessing
samples_count, rows_count, columns_count = dataset.shape
dataset = dataset.reshape((samples_count, rows_count * columns_count))
dataset = preprocessing.StandardScaler().fit_transform(dataset)
dataset = dataset.reshape(samples_count, rows_count, columns_count)