> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8a08bda2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 컬럼 값의 Shannon 엔트로피를 계산합니다.

# entropy

<div id="entropy">
  ## entropy
</div>

도입 버전: v20.1.0

값으로 이루어진 컬럼의 [Shannon 엔트로피](https://en.wikipedia.org/wiki/Entropy_\(information_theory\))를 계산합니다.

**구문**

```sql theme={null}
entropy(val)
```

**인수**

* `val` — 모든 타입의 값을 포함하는 컬럼입니다. [`Any`](/ko/reference/data-types)

**반환 값**

Shannon 엔트로피를 반환합니다. [`Float64`](/ko/reference/data-types/float)

**예시**

**기본 엔트로피 계산**

```sql title=Query theme={null}
CREATE TABLE entropy (`vals` UInt32,`strings` String)
ENGINE = Memory;

INSERT INTO entropy VALUES (1, 'A'), (1, 'A'), (1,'A'), (1,'A'), (2,'B'), (2,'B'), (2,'C'), (2,'D');

SELECT entropy(vals), entropy(strings) FROM entropy
```

```response title=Response theme={null}
┌─entropy(vals)─┬─entropy(strings)─┐
│             1 │             1.75 │
└───────────────┴──────────────────┘
```
