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

Method partitions

dask/dataframe/dask_expr/_collection.py:834–853  ·  view source on GitHub ↗

Slice dataframe by partitions This allows partitionwise slicing of a Dask Dataframe. You can perform normal Numpy-style slicing, but now rather than slice elements of the array you slice along partitions so, for example, ``df.partitions[:5]`` produces a new Dask Dat

(self)

Source from the content-addressed store, hash-verified

832
833 @property
834 def partitions(self):
835 """Slice dataframe by partitions
836
837 This allows partitionwise slicing of a Dask Dataframe. You can perform normal
838 Numpy-style slicing, but now rather than slice elements of the array you
839 slice along partitions so, for example, ``df.partitions[:5]`` produces a new
840 Dask Dataframe of the first five partitions. Valid indexers are integers, sequences
841 of integers, slices, or boolean masks.
842
843 Examples
844 --------
845 >>> df.partitions[0] # doctest: +SKIP
846 >>> df.partitions[:3] # doctest: +SKIP
847 >>> df.partitions[::10] # doctest: +SKIP
848
849 Returns
850 -------
851 A Dask DataFrame
852 """
853 return IndexCallable(self._partitions)
854
855 def get_partition(self, n):
856 """

Callers

nothing calls this directly

Calls 1

IndexCallableClass · 0.90

Tested by

no test coverage detected