DataframeShuffle
Shuffle the rows within a dataframe to randomize the order of the rows. This is useful for pulling dataframe from a dataset in a randomized, especially when the data is initially organized by some factor.
Examples
Example 1 - Randomize the Order of Rows in a Dataframe
When exploring or analyzing data, it’s sometimes helpful to work with the rows in a different order. The DataframeShuffle kit randomizes the order of all rows in the dataframe. This is useful when you want to remove ordering effects or prepare the data for sampling or testing. The original data is unchanged except for the new row order.
#> DataframeShuffle
AFLEFT
weatherDf = weatherDf.sample(frac=1).reset_index(drop=True) AFRIGHT