# Variable$get\_statistics

### Variable$<mark style="color:purple;">get\_statistics</mark>() → *list*

Fetches the statistics for the variable, returning a named list corresponding to the [VariableStatistics resource definition](/api/resource-definitions/variablestatistics.md).&#x20;

If the statistics haven't yet been computed, will wait for statistics to compute before returning. Will raise an error if the variable does not exist.

### **Returns:**

**list (**[**see VariableStatistics resource definition**](/api/resource-definitions/variablestatistics.md)**)**

### Examples:

```python
table <- redivis$organization("Demo")$dataset("iris_species")$table("iris")

statistics <- table$variable("sepalLengthCm")$get_statistics()

print(statistics)

{
	"kind": "variableStatistics",
	"status": "completed",
	"count": 150,
	"numDistinct": 35,
	"min": 4.3,
	"max": 7.9,
	"mean": 5.8433333333333355,
	"approxMedian": 0.8280661279778625,
	...
}
```


---

# 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.redivis.com/api/client-libraries/redivis-r/reference/variable/variableusdget_statistics.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.
