Randomly shuffle the order
🎲 Sampling settings
💡 Instructions for use
- Sampling by line number is suitable for "sampling a fixed number of samples"; sampling by proportion is suitable for "sampling a certain proportion of samples", and the proportion is calculated based on the number of sampled rows.
- The shuffle mode retains all rows and only randomly rearranges the order. It is used for preparation before random sorting and random grouping.
- When repetition is prohibited, each row can be sampled at most once, and the result can be used directly as a list; when repetition is allowed, it is equivalent to sampling with replacement, and duplicate rows may appear.
- When retaining the table header, the first row will not participate in sampling, and the results will still start with the table header, making it easy to paste directly back to the spreadsheet software.
- The result area will provide the number of rows, sampling ratio and selected row number to facilitate one-by-one verification with the original data.
- The data is only processed in the browser and is not uploaded or saved; if you need to keep the file, please copy or download the results.
Keep all data and only change the order of rows for random sorting and grouping preparation.
Three typical uses
Purpose 1: Eliminate sequence deviation. Raw data is often arranged by time or number. After being scrambled, it is avoided to "always draw the first few items".
Purpose 2: Prepare for grouping. After being shuffled and divided into fixed numbers, random groups are obtained.
Purpose 3: Generate a randomly sorted list. Such as exam seats, order of speaking, order of taking the stage.
Specific methods of grouping
The first step: scramble all data rows (the table header is fixed).
Step 2: Calculate the number of pieces in each group according to "Total number of people ÷ Number of groups" and cut them into pieces from top to bottom.
Step 3: If it cannot be divided evenly, add one person to each of the first few groups, and the difference in number should be controlled within one person.
Note
After being scrambled, you must keep a copy of the original sequence, or add a column of original serial numbers first, otherwise it cannot be restored.
If you need the number of people in each group to be strictly equal when grouping, you must first delete the redundant rows or allow individual groups to have one less person.
Verify
Verification method: Compare the number of rows before and after scrambling, they should be exactly the same (no data is added or deleted during scrambling).
Sorting by the original serial number column should restore the original order.
Before scrambling, add a column of original serial numbers: otherwise, once scrambled, the original sequence cannot be restored.
📖 Glossary
- random sampling
- Select a part of the data as a sample according to random rules, and use the sample to reflect the overall situation.
- sample size
- The number of rows extracted. The larger the sample size, the closer it is to the whole, but the processing cost is also higher.
- Sampling proportion
- The sample size is a percentage of the number of rows that can be sampled, often used to draw at a fixed ratio.
- Sampling with replacement
- The row is put back after each draw, so the same row may be drawn repeatedly.
- Sampling without replacement
- The extracted rows will no longer participate in subsequent extraction, and each row will appear at most once in the results.
- sampling bias
- Systematic errors occur when the sample does not represent the whole, for example, only data from a certain time period is taken.
- stratified sampling
- First group the samples by category, and then sample each group separately so that each category is represented in the sample.
- shuffle randomly
- It only rearranges the order of rows without deleting any rows. It is often used in preparation before random sorting and grouping.
- Winning bank number
- The serial number of the selected row in the data is used to check with the original data one by one.
- Reproducibility
- The property of obtaining the same result under the same conditions. Random sampling is not available by default, and the output needs to be saved to reproduce.
🔗 All keywords and tutorials
❓ FAQ
- Will data be lost??
- No. Shuffling only changes the order, but the number of lines and content remain unchanged.
- How to randomly group?
- Shuffle it first, and then cut it into pieces from top to bottom according to the number of pieces in each group.