Hongmu Notes

🎲 random sampling tool

Paste the data and set the number or ratio of sampling items to randomly select a number of rows; you can retain the table header and prohibit duplication, or you can just disrupt the order of the data.
100% Browser local processing 0 Data upload

🎲 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.

🎲 How to choose between the three modes

When you need a fixed number of samples, choose by number, such as selecting several records for manual review; when you need to maintain the overall proportion, choose proportional, such as taking 20% of the orders for random inspection; when you just want to change the order without deleting the data, choose shuffle the order, which is used for preparation before random sorting and random grouping. The only difference between the three modes is the selection method, and the output format is completely the same.

Confirm the sample size before sampling. If the sample is too small, the deviation will be amplified, and if the sample is too large, the significance of sampling will be lost.

🔁 The difference between allowing duplication and prohibiting duplication

When duplication is prohibited, the extracted rows are different from each other, and the result can be used directly as a list, such as a lottery list and a random inspection list. Allowing repetition is equivalent to sampling with replacement, and the same row may appear twice, which is suitable for statistical simulation purposes. In most business scenarios, you should choose to prohibit duplication to avoid duplicate items in the list.

When using it for prize distribution or random inspection, be sure to select prohibit duplication, so that the results can be used directly.

🧭 Two common sources of sampling bias

First, the data itself is ordered, such as logs arranged in chronological order. Random sampling will cause accidental imbalances, but these are random errors; second, the data itself has a category structure, such as lists containing multiple departments, and pure random sampling may not result in the entire group being selected. The latter should instead adopt the method of first grouping by category and then sampling separately within the group to ensure that each category is represented.

When the data has obvious categories, it is recommended to group them according to categories and then sample them separately.

🔗 All keywords and tutorials

Keywords page of the tool12a

Return to tool home page

❓ FAQ

Are the sampling results random??
The tool uses the browser's random number generator, and the results may be different each time it is run; please save this output when you need reproducible results.
Will extraction change the original data??
No. The tool only generates sampling results on the page, and the original pasted content will not be modified or uploaded.
What will happen if you fill in too many entries??
When the number of sampled rows is exceeded, the tool outputs all rows and gives a prompt without repeated filling.
How to check which rows were drawn?
The result area will list the selected row numbers, and you can go back to the original data to check them one by one. The row numbers are calculated from the rows that can be sampled together.
Will the data be uploaded??
No. Sampling is done entirely within the browser, pasted content is not sent to the server.