Skip to content

Inconsistency between doc and code for repartition? #3439

Closed

Description

@joergdietrich

The docstring for dataframe.repartition states

npartitions : int, optional
    Number of partitions of output, must be less than npartitions of
    input.

yet there seems to be working code for increasing the number of partitions.


import numpy as np
import pandas as pd
import dask.dataframe as dd

X = np.random.normal(size=(1_000_000, 2))
df = pd.DataFrame(X, columns=['A', 'B'])
ddf = dd.from_pandas(df, npartitions=5)
ddf2 = ddf.repartition(npartitions=10)
assert ddf.npartitions == 5
assert ddf2.npartitions == 10
assert np.allclose((ddf**2).compute(), (ddf2**2).compute())

This is with dask 0.17.2, Python 3.6, pandas 0.22.0.

Activity

  1. mrocklin commented on Apr 25, 2018

    @mrocklin
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions