I have a list of objects and I want to shuffle them. I thought I could use the random.shuffle method, but this seems to fail when the list is of objects. Is the
random.shuffle
If you happen to be using numpy already (very popular for scientific and financial applications) you can save yourself an import.
import numpy as np np.random.shuffle(b) print(b)
https://numpy.org/doc/stable/reference/random/generated/numpy.random.shuffle.html