MCPcopy Create free account
hub / github.com/dask/dask / choice

Method choice

dask/array/_array_expr/random.py:121–146  ·  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

119
120 @derived_from(np.random.Generator, skipblocks=1)
121 def choice(
122 self,
123 a,
124 size=None,
125 replace=True,
126 p=None,
127 axis=0,
128 shuffle=True,
129 chunks="auto",
130 ):
131 (
132 a,
133 size,
134 replace,
135 p,
136 axis,
137 chunks,
138 meta,
139 dependencies,
140 ) = _choice_validate_params(self, a, size, replace, p, axis, chunks)
141
142 return new_collection(
143 RandomChoiceGenerator(
144 a.expr, chunks, meta, self._bit_generator, replace, p, axis, shuffle
145 )
146 )
147
148 @derived_from(np.random.Generator, skipblocks=1)
149 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