fatia ordenada aleatória de uma matriz

import random as rd
import numpy as np

mylist = list(np.linspace(0,50,50))
sliceSize = 3 # +1 below because python start counting frfom zero
result = mylist[rd.randrange(len(mylist)-sliceSize+1):][:sliceSize]
print(result)
Output: [6.122448979591837, 7.142857142857143, 8.16326530612245]
Coderunner