shuffle_column#
- shuffle_column(graph_df, col_number=None, col_name=None, inplace=False)[source]#
Returns an edgelist with a given column shuffled. Exactly one of col_number or col_name should be specified.
- Parameters:
graph_df (DataFrame) – The input DataFrame representing the timestamped edgelist.
col_number (int, optional) – The column number to shuffle. Default is None.
col_name (str, optional) – The column name to shuffle. Default is None.
inplace (bool, optional) – If True, shuffles the column in-place. Otherwise, creates a copy of the DataFrame. Default is False.
- Returns:
The shuffled DataFrame with the specified column.
- Return type:
- Raises:
AssertionError – If neither col_number nor col_name is provided.
AssertionError – If both col_number and col_name are provided.