text_plain_output_1.png
from scipy import stats

import numpy as np

unique, counts = np.unique(y_train, return_counts=True)

unique, counts = np.unique(y_test, return_counts=True)

review_len_train = []
review_len_test = []
for i, ii in zip(x_train, x_test):
    review_len_train.append(len(i))
    review_len_test.append(len(ii))

print('Train mean:', np.mean(review_len_train))
print('Train median:', np.median(review_len_train))
print('Train mode:', stats.mode(review_len_train))