original_docstring:  Shuffle dataframe so that column separates along divisions 
docstring: Shuffle dataframe so that column separates along divisions
docstring_tokens: Shuffle dataframe so that column separates along divisions
code: def rearrange_by_divisions(df, column, divisions, max_branch=None, shuffle=None):
      """ Shuffle dataframe so that column separates along divisions """
      # Assign target output partitions to every row
      partitions = df[column].map_partitions(
          set_partitions_pre, divisions=divisions, meta=pd.Series([0])
      )
      df2 = df.assign(_partitions=partitions)
  
      # Perform shuffle
      df3 = rearrange_by_column(
          df2,
          "_partitions",
          max_branch=max_branch,
          npartitions=len(divisions) - 1,
          shuffle=shuffle,
      )
      del df3["_partitions"]
      return df3
code_tokens: def rearrange_by_divisions ( df , column , divisions , max_branch = None , shuffle = None ) : partitions = df [ column ] . map_partitions ( set_partitions_pre , divisions = divisions , meta = pd . Series ( [ 0 ] ) ) df2 = df . assign ( _partitions = partitions ) df3 = rearrange_by_column ( df2 , "_partitions" , max_branch = max_branch , npartitions = len ( divisions ) - 1 , shuffle = shuffle , ) del df3 [ "_partitions" ] return df3
short_docstring: Shuffle dataframe so that column separates along divisions
short_docstring_tokens: Shuffle dataframe so that column separates along divisions
comment: """ Shuffle dataframe so that column separates along divisions """$SEP$# Assign target output partitions to every row$SEP$# Perform shuffle