expyriment.design.randomize¶
The expyriment randomize module.
This module contains various functions for randomizing data
Functions¶
-
expyriment.design.randomize.
make_multiplied_shuffled_list
(list_, xtimes)[source]¶ Return the multiplied and shuffled (sectionwise) list.
The function manifolds the list ‘x times’ and shuffles each and concatenates to the return new lists.
Parameters: list_ : list
list to be shuffled
xtimes : int
how often the list will be multiplied
-
expyriment.design.randomize.
rand_int
(a, b)[source]¶ Return random integer in given range.
Parameters: a : int
first element of range
b : int
last element of range
-
expyriment.design.randomize.
rand_int_sequence
(first_elem, last_elem)[source]¶ Return a randomised sequence of integers in given range.
Parameters: first_elem : int
first element of the range
last_elem : int
last element of the range
-
expyriment.design.randomize.
shuffle_list
(list_, max_repetitions=None, n_segments=None)[source]¶ Shuffle any list of objects. In place randomization of the list.
Parameters: list_ : int
list to shuffle
max_repetitions : int, optional
maximum number of allowed repetitions of one identical items; if no solution can be found (i.e., Python’s recursion limit is reached), the function returns False and the list will be randomized without constrains (see Notes); default = None
n_segments : int, optional
randomize list per segment, i.e., list will be divided into n equal sized segments and the order of elements within each segment will be randomized; if n_segments is None or < 2, this parameter has no effect; default = None
Returns: success : bool
returns if randomization was successful and fulfilled the specified constrains (see max_repetitions)