This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
NGRAMS | |
Converts a text string to n-grams | |
Inputs: | |
- text (string): the text string to convert | |
- n (int): the number of elements to output in each n-gram | |
- strict (bool): whether to output incomplete n-grams at the end of the array | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
ONEHOT | |
One-hot encodes a catagorical variable | |
Inputs | |
- rng: a single-column array or range of categorical data (usually text) | |
Returns | |
For each unique value v in rng, a new column with header rng.header & "_" & v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
LEV | |
Calculates the Levenshtein distance between two strings | |
Inputs | |
- a: a string to compare with b | |
- b: a string to compare with a | |
- [ii]: the [ii]th position in string a | |
- [jj]: the [jj]th position in string b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
RECURSIVEFILTER | |
Filters an array or range recursively using a list of columns and criteria to apply | |
Inputs | |
- dat: the array or range of data to filter | |
- cols: Either a one-dimensional horizontal array of column indices representing | |
columns in dat. e.g. {1,2} means "filter columns 1 and 2" | |
OR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
GROUPAGGREGATE | |
Creates summary tables of data similar to SQL's GROUP BY queries | |
Inputs | |
- dat: a range or array of data with at least two columns, | |
one of which's control value must be "group" and one not "group" | |
- control: a single-row array, where COLUMNS(control)=COLUMNS(dat), of values from this list: | |
group - the values in this column will be output as row headers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
DESCRIBE | |
Creates tables of statistics similar to the Analysis Toolpak Add-in "Summary statistics" feature. | |
Including support for text columns and additional statistics for numeric columns. | |
Inputs | |
- data: a range or array of data with at least one column | |
- has_header: TRUE if data includes a header row, FALSE otherwise | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
GROWTHFROMOFFSET | |
Calculates the growth that a current month represents when compared | |
to the same measure an arbitrary number of months ago | |
Inputs: | |
- month_col: a Table column, a cell range (using absolute references) or an array containing the months formatted as dates | |
- value_col : a Table column, a cell range (using absolute references) or an array containing the values | |
- month_offset : the number of months prior to the month on the current row that you want to compare with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
FORECAST.ETS.COMPARE | |
Creates an array enabling comparison of actuals vs forecasted data | |
Inputs: | |
Required: | |
- data - this is a two-column range or array of data where one of the columns contains dates and one of the columns contains the values to be used as the basis for the forecast | |
- dates_in_column - is an integer, either 1 or 2, telling the function which of the two selected columns in data contains the dates | |
- values_in_column - is an integer, either 1 or 2, telling the function which of the two selected columns in data contains the values to be used as the basis for the forecast |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
ISLEAPYEAR | |
Calculates whether a year is a leap year | |
Inputs: | |
- yr is the year you want to test | |
Returns: | |
TRUE if the year is a leap year, FALSE otherwise |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
OUTLIERS | |
These lambda functions allow us to quickly apply the standard deviation test to a series of transformed variables | |
Included in this file: | |
OUTLIER.THRESHOLDS - for calculating outlier thresholds using a standard deviation test | |
inputs: |
OlderNewer