#!/usr/bin/env python3 import numpy as np a = np.array([89, 34, 56, 87, 90, 23, 45, 12, 65, 78, 9, 34, 12, 11, 2, 65, 78, 82, 28, 78]) # Generamos un vector de 100 elementos con valores aleatorios entre 0 y 10 a = np.random.randint(0,11,100) print(a) histogram = np.histogram(a) print(histogram) ''' [ 6 6 6 7 0 7 7 4 3 8 10 0 8 3 10 0 10 7 8 6 0 1 0 2 9 8 2 5 3 7 4 6 3 10 3 4 2 0 4 4 3 2 9 0 1 7 10 7 10 9 8 7 5 4 9 0 3 9 10 10 3 10 2 2 5 4 0 6 9 2 8 5 2 9 6 2 5 8 9 5 6 4 5 3 6 1 10 4 4 2 10 7 9 8 1 5 7 6 4 2] (array([ 9, 4, 11, 9, 11, 8, 10, 10, 8, 20]), array([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10.])) '''