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

Method divisions

dask/dataframe/dask_expr/_collection.py:367–388  ·  view source on GitHub ↗

Tuple of ``npartitions + 1`` values, in ascending order, marking the lower/upper bounds of each partition's index. Divisions allow Dask to know which partition will contain a given value, significantly speeding up operations like `loc`, `merge`, and `groupby` by not

(self)

Source from the content-addressed store, hash-verified

365
366 @property
367 def divisions(self):
368 """
369 Tuple of ``npartitions + 1`` values, in ascending order, marking the
370 lower/upper bounds of each partition's index. Divisions allow Dask
371 to know which partition will contain a given value, significantly
372 speeding up operations like `loc`, `merge`, and `groupby` by not
373 having to search the full dataset.
374
375 Example: for ``divisions = (0, 10, 50, 100)``, there are three partitions,
376 where the index in each partition contains values [0, 10), [10, 50),
377 and [50, 100], respectively. Dask therefore knows ``df.loc[45]``
378 will be in the second partition.
379
380 When every item in ``divisions`` is ``None``, the divisions are unknown.
381 Most operations can still be performed, but some will be much slower,
382 and a few may fail.
383
384 It is not supported to set ``divisions`` directly. Instead, use ``set_index``,
385 which sorts and splits the data as needed.
386 See https://docs.dask.org/en/latest/dataframe-design.html#partitions.
387 """
388 return self.expr.divisions
389
390 @property
391 def npartitions(self):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected