def repartition(df, divisions=None, force=False):
 token = tokenize(df, divisions)
 if isinstance(df, _Frame):
  tmp = ('repartition-split-' + token)
  out = ('repartition-merge-' + token)
  dsk = repartition_divisions(df.divisions, divisions, df._name, tmp, out, force=force)
  return new_dd_object(merge(df.dask, dsk), out, df._meta, divisions)
 elif isinstance(df, (pd.Series, pd.DataFrame)):
  name = ('repartition-dataframe-' + token)
  from .utils import shard_df_on_index
  dfs = shard_df_on_index(df, divisions[1:(-1)])
  dsk = dict((((name, i), df) for (i, df) in enumerate(dfs)))
  return new_dd_object(dsk, name, df, divisions)
 raise ValueError('Data must be DataFrame or Series')

def repartition ( df , divisions = None , force = False ) : token = tokenize ( df , divisions ) if isinstance ( df , _Frame ) : tmp = ( 'repartition-split-' + token ) out = ( 'repartition-merge-' + token ) dsk = repartition_divisions ( df . divisions , divisions , df . _name , tmp , out , force = force ) return new_dd_object ( merge ( df . dask , dsk ) , out , df . _meta , divisions ) elif isinstance ( df , ( pd . Series , pd . DataFrame ) ) : name = ( 'repartition-dataframe-' + token ) from . utils import shard_df_on_index dfs = shard_df_on_index ( df , divisions [ 1 : ( - 1 ) ] ) dsk = dict ( ( ( ( name , i ) , df ) for ( i , df ) in enumerate ( dfs ) ) ) return new_dd_object ( dsk , name , df , divisions ) raise ValueError ( 'Data must be DataFrame or Series' )
repartition dataframe along new divisions dask .