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

Function linspace

dask/array/_array_expr/_creation.py:243–286  ·  view source on GitHub ↗

Return `num` evenly spaced values over the closed interval [`start`, `stop`]. Parameters ---------- start : scalar The starting value of the sequence. stop : scalar The last value of the sequence. num : int, optional Number of samples to include

(
    start, stop, num=50, endpoint=True, retstep=False, chunks="auto", dtype=None
)

Source from the content-addressed store, hash-verified

241
242
243def linspace(
244 start, stop, num=50, endpoint=True, retstep=False, chunks="auto", dtype=None
245):
246 """
247 Return `num` evenly spaced values over the closed interval [`start`,
248 `stop`].
249
250 Parameters
251 ----------
252 start : scalar
253 The starting value of the sequence.
254 stop : scalar
255 The last value of the sequence.
256 num : int, optional
257 Number of samples to include in the returned dask array, including the
258 endpoints. Default is 50.
259 endpoint : bool, optional
260 If True, ``stop`` is the last sample. Otherwise, it is not included.
261 Default is True.
262 retstep : bool, optional
263 If True, return (samples, step), where step is the spacing between
264 samples. Default is False.
265 chunks : int
266 The number of samples on each block. Note that the last block will have
267 fewer samples if `num % blocksize != 0`
268 dtype : dtype, optional
269 The type of the output array.
270
271 Returns
272 -------
273 samples : dask array
274 step : float, optional
275 Only returned if ``retstep`` is True. Size of spacing between samples.
276
277 See Also
278 --------
279 dask.array.arange
280 """
281 num = int(num)
282 result = new_collection(Linspace(start, stop, num, endpoint, chunks, dtype))
283 if retstep:
284 return result, result.expr.step
285 else:
286 return result
287
288
289def empty_like(a, dtype=None, order="C", chunks=None, name=None, shape=None):

Callers

nothing calls this directly

Calls 2

new_collectionFunction · 0.90
LinspaceClass · 0.85

Tested by

no test coverage detected