text_plain_output_1.png
from keras.datasets import imdb

import matplotlib.pyplot as plt

import numpy as np

(X_train, y_train), (X_test, y_test) = imdb.load_data()
X = np.concatenate((X_train, X_test), axis=0)
y = np.concatenate((y_train, y_test), axis=0)

print('Review length: ')
result = list(map(len, X))
print('Mean %.2f words (%f)' % (np.mean(result), np.std(result)))
fig, ax = plt.subplots(figsize=(10, 5))
ax.set_title('Boxplot of review lenght')
ax.boxplot(result)