from matplotlib import pyplot as plt
import numpy as np
import random
#Divide any number(Division number,Data list)
def division_datas(division_length, datas):
sort_data = sorted(datas)
datas = [sort_data[i:i+division_length] for i in range(0, len(datas), division_length)]
return datas
#0~Generate 100 random numbers of 100
my_data = [random.randint(0, 100) for i in range(100)]
#Try to divide the data into 15
division_data_ls = division_datas(15, my_data)
print(division_data_ls)
Recommended Posts