original_docstring:  Group DataFrame by index
  
      Hash grouping of elements. After this operation all elements that have
      the same index will be in the same partition. Note that this requires
      full dataset read, serialization and shuffle. This is expensive. If
      possible you should avoid shuffles.
  
      This does not preserve a meaningful index/partitioning scheme. This is not
      deterministic if done in parallel.
  
      See Also
      --------
      set_index
      set_partition
      shuffle_disk
      
docstring: Group DataFrame by index
  Hash grouping of elements. After this operation all elements that have
  the same index will be in the same partition. Note that this requires
  full dataset read, serialization and shuffle. This is expensive. If
  possible you should avoid shuffles.
  
  This does not preserve a meaningful index/partitioning scheme. This is not
  deterministic if done in parallel.
  
  See Also
  
  
docstring_tokens: Group DataFrame by index Hash grouping of elements . After this operation all elements that have the same index will be in the same partition . Note that this requires full dataset read serialization and shuffle . This is expensive . If possible you should avoid shuffles . This does not preserve a meaningful index / partitioning scheme . This is not deterministic if done in parallel . See Also
code: def shuffle(df, index, shuffle=None, npartitions=None, max_branch=32, compute=None):
      """ Group DataFrame by index
  
      Hash grouping of elements. After this operation all elements that have
      the same index will be in the same partition. Note that this requires
      full dataset read, serialization and shuffle. This is expensive. If
      possible you should avoid shuffles.
  
      This does not preserve a meaningful index/partitioning scheme. This is not
      deterministic if done in parallel.
  
      See Also
      --------
      set_index
      set_partition
      shuffle_disk
      """
      if not isinstance(index, _Frame):
          index = df._select_columns_or_index(index)
  
      partitions = index.map_partitions(
          partitioning_index,
          npartitions=npartitions or df.npartitions,
          meta=pd.Series([0]),
          transform_divisions=False,
      )
      df2 = df.assign(_partitions=partitions)
      df2._meta.index.name = df._meta.index.name
      df3 = rearrange_by_column(
          df2,
          "_partitions",
          npartitions=npartitions,
          max_branch=max_branch,
          shuffle=shuffle,
          compute=compute,
      )
      del df3["_partitions"]
      return df3
code_tokens: def shuffle ( df , index , shuffle = None , npartitions = None , max_branch = 32 , compute = None ) : if not isinstance ( index , _Frame ) : index = df . _select_columns_or_index ( index ) partitions = index . map_partitions ( partitioning_index , npartitions = npartitions or df . npartitions , meta = pd . Series ( [ 0 ] ) , transform_divisions = False , ) df2 = df . assign ( _partitions = partitions ) df2 . _meta . index . name = df . _meta . index . name df3 = rearrange_by_column ( df2 , "_partitions" , npartitions = npartitions , max_branch = max_branch , shuffle = shuffle , compute = compute , ) del df3 [ "_partitions" ] return df3
short_docstring: Group DataFrame by index
  Hash grouping of elements.
short_docstring_tokens: Group DataFrame by index Hash grouping of elements .
comment: """ Group DataFrame by index
  
      Hash grouping of elements. After this operation all elements that have
      the same index will be in the same partition. Note that this requires
      full dataset read, serialization and shuffle. This is expensive. If
      possible you should avoid shuffles.
  
      This does not preserve a meaningful index/partitioning scheme. This is not
      deterministic if done in parallel.
  
      See Also
      --------
      set_index
      set_partition
      shuffle_disk
      """