dataFrame.column.stat — entropy()
Description
The entropy() method of the stat object returns the Shannon entropy of the values in the selected column.
Signature
dataFrame.column(columnName).stat.entropy()Argument
columnName(string)- The name of the column from which to calculate the entropy.
Returns
entropy(number)- The Shannon entropy.
Notes
- Higher values indicate greater uncertainty or diversity in the distribution of values.
- Lower values indicate a more concentrated or predictable distribution.
Example
// get the entropy from values of a column of the dataFrame
var entropy = dataFrame.column('revenue').stat.entropy();
// log the entropy
notebook.log(entropy);