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

Method _partitions

dask/dataframe/dask_expr/_collection.py:779–791  ·  view source on GitHub ↗
(self, index)

Source from the content-addressed store, hash-verified

777 )
778
779 def _partitions(self, index):
780 # Used by `partitions` for partition-wise slicing
781
782 # Convert index to list
783 if isinstance(index, int):
784 index = [index]
785 index = np.arange(self.npartitions, dtype=object)[index].tolist()
786
787 # Check that selection makes sense
788 assert set(index).issubset(range(self.npartitions))
789
790 # Return selected partitions
791 return new_collection(expr.Partitions(self, index))
792
793 @property
794 def partitions(self):

Callers

nothing calls this directly

Calls 3

new_collectionFunction · 0.90
setClass · 0.85
arangeMethod · 0.45

Tested by

no test coverage detected