- Bag.repartition(npartitions=None, partition_size=None)[source]¶
Repartition Bag across new divisions.
- npartitionsint, optional
Number of partitions of output.
- partition_sizeint or string, optional
Max number of bytes of memory for each partition. Use numbers or strings like 5MB.
This keyword argument triggers computation to determine the memory size of each partition, which may be expensive.
Exactly one of
partition_sizeshould be specified. A
ValueErrorwill be raised when that is not the case.
>>> b.repartition(5) # set to have 5 partitions