get_random_sample#

Object3d.get_random_sample(size: Optional[int] = 1, replace: bool = False, shuffle: bool = False)[source]#

Return a random sample of a given size in a flattened instance.

Parameters:
size

Number of samples to draw. Cannot be greater than the size of this instance. If not given, a single sample is drawn.

replace

See numpy.random.Generator.choice().

shuffle

See numpy.random.Generator.choice().

Returns:
new

New, flattened instance of a given size with elements drawn randomly from this instance.