-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem or challenge?
Calculates Shannon entropy of a column of values.
Describe the solution you'd like
D CREATE TABLE entropy (vals UInt32,strings String);
D INSERT INTO entropy VALUES (1, 'A'), (1, 'A'), (1,'A'), (1,'A'), (2,'B'), (2,'B'), (2,'C'), (2,'D');
D
D SELECT entropy(vals), entropy(strings) FROM entropy;
┌───────────────┬──────────────────┐
│ entropy(vals) │ entropy(strings) │
│ double │ double │
├───────────────┼──────────────────┤
│ 1.0 │ 1.75 │
└───────────────┴──────────────────┘
Describe alternatives you've considered
No response
Additional context
https://duckdb.org/docs/sql/functions/aggregates#entropyx
https://clickhouse.com/docs/en/sql-reference/aggregate-functions/reference/entropy
matthewmturner
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request