MCPcopy Index your code
hub / github.com/dask/dask / choice

Method choice

dask/array/_array_expr/random.py:119–144  ·  view source on GitHub ↗
(
        self,
        a,
        size=None,
        replace=True,
        p=None,
        axis=0,
        shuffle=True,
        chunks="auto",
    )

Source from the content-addressed store, hash-verified

117
118 @derived_from(np.random.Generator, skipblocks=1)
119 def choice(
120 self,
121 a,
122 size=None,
123 replace=True,
124 p=None,
125 axis=0,
126 shuffle=True,
127 chunks="auto",
128 ):
129 (
130 a,
131 size,
132 replace,
133 p,
134 axis,
135 chunks,
136 meta,
137 dependencies,
138 ) = _choice_validate_params(self, a, size, replace, p, axis, chunks)
139
140 return new_collection(
141 RandomChoiceGenerator(
142 a.expr, chunks, meta, self._bit_generator, replace, p, axis, shuffle
143 )
144 )
145
146 @derived_from(np.random.Generator, skipblocks=1)
147 def exponential(self, scale=1.0, size=None, chunks="auto", **kwargs):

Callers 6

test_cupy_unsupportedFunction · 0.45
test_whereFunction · 0.45
test_choiceFunction · 0.45
_choice_rngFunction · 0.45
_choice_validate_paramsFunction · 0.45

Calls 3

new_collectionFunction · 0.90
_choice_validate_paramsFunction · 0.70

Tested by 4

test_cupy_unsupportedFunction · 0.36
test_whereFunction · 0.36
test_choiceFunction · 0.36