# Sample

Sample n rows from the data frame (Sample N Rows) or sample n fraction of rows from the data frame (Sample Fraction)

## How to Access This Feature

![](/files/-M4oMybAya6nOrelRU0h)

### Sample (N Rows)

* Click "+" button and select "Others ..." -> "Sample ..." -> N Rows

### Sample (Fraction)

* Click "+" button and select "Others ..." -> "Sample ..." -> Fraction

## Sample (N Rows)

![](/files/-M4oMybGP0upyRxK_Kj9)

1. Enter Sample Number - Number of rows you want to sample the data. (e.g. 10000)
2. Select `Weight Colulmn` (Optional) - Sampling weight. The ratio of probability the row should be chosen. This should be non-negative numeric vector whose size is the number of rows. It's normalized so that the sum of the probability will be 1.
3. Replace Sampled Rows (Options) - The default is FALSE. If it's TRUE, replacement will be executed when sampling.
4. Click "Run" to Sample data frame.

## Sample (Fraction)

![](/files/-M4oMybIBYdCaf0rPrJi)

1. Enter Sample Fraction ratio. It should be a numeric value between 0 and 1. (e.g. 0.4)
2. Select `Weight Colulmn` (Optional) - Sampling weight. The ratio of probability the row should be chosen. This should be non-negative numeric vector whose size is the number of rows. It's normalized so that the sum of the probability will be 1.
3. Replace Sampled Rows (Options) - The default is FALSE. If it's TRUE, replacement will be executed when sampling.
4. Click "Run" to Sample data frame.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.exploratory.io/data-wrangling/sample.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
