UNPKG

dataframe-js

Version:

Immutable and functional data structure for datascientists and developpers

215 lines (121 loc) 5.05 kB
<!-- Generated by documentation.js. Update this documentation by updating the source code. --> ### Table of Contents - [Stat][1] - [sum][2] - [max][3] - [min][4] - [mean][5] - [average][6] - [var][7] - [sd][8] - [stats][9] ## Stat [src/modules/stat.js:6-154][10] Stat module for DataFrame, providing basic statistical metrics for numeric columns. **Parameters** - `df` **DataFrame** An instance of DataFrame. ### sum [src/modules/stat.js:29-39][11] Compute the sum of a numeric column. **Parameters** - `columnName` **[String][12]** The column to evaluate, containing Numbers. **Examples** ```javascript df.stat.sum('column1') ``` Returns **[Number][13]** The sum of the column. ### max [src/modules/stat.js:48-52][14] Compute the maximal value into a numeric column. **Parameters** - `columnName` **[String][12]** The column to evaluate, containing Numbers. **Examples** ```javascript df.stat.max('column1') ``` Returns **[Number][13]** The maximal value into the column. ### min [src/modules/stat.js:61-65][15] Compute the minimal value into a numeric column. **Parameters** - `columnName` **[String][12]** The column to evaluate, containing Numbers. **Examples** ```javascript df.stat.min('column1') ``` Returns **[Number][13]** The minimal value into the column. ### mean [src/modules/stat.js:74-87][16] Compute the mean value into a numeric column. **Parameters** - `columnName` **[String][12]** The column to evaluate,isNumber(n.get(columnName)) ? p + Number( containing Numbers. **Examples** ```javascript df.stat.mean('column1') ``` Returns **[Number][13]** The mean value into the column. ### average [src/modules/stat.js:97-99][17] Compute the mean value into a numeric column. Alias from mean. **Parameters** - `columnName` **[String][12]** The column to evaluate, containing Numbers. **Examples** ```javascript df.stat.min('column1') ``` Returns **[Number][13]** The mean value into the column. ### var [src/modules/stat.js:109-121][18] Compute the variance into a numeric column. **Parameters** - `columnName` **[String][12]** The column to evaluate, containing Numbers. - `population` **[Boolean][19]** Population mode. If true, provide the population variance, not the sample one. (optional, default `false`) **Examples** ```javascript df.stat.var('column1') ``` Returns **[Number][13]** The variance into the column. ### sd [src/modules/stat.js:131-133][20] Compute the standard deviation into a numeric column. **Parameters** - `columnName` **[String][12]** The column to evaluate, containing Numbers. - `population` **[Boolean][19]** Population mode. If true, provide the population standard deviation, not the sample one. (optional, default `false`) **Examples** ```javascript df.stat.sd('column1') ``` Returns **[Number][13]** The standard deviation into the column. ### stats [src/modules/stat.js:142-153][21] Compute all the stats available with the Stat module on a numeric column. **Parameters** - `columnName` **[String][12]** The column to evaluate, containing Numbers. **Examples** ```javascript df.stat.stats('column1') ``` Returns **[Object][22]** An dictionnary containing all statistical metrics available. [1]: #stat [2]: #sum [3]: #max [4]: #min [5]: #mean [6]: #average [7]: #var [8]: #sd [9]: #stats [10]: https://github.com/Gmousse/dataframe-js/blob/cef738e8a8e82e94515dfc49f015f842a8c410f2/src/modules/stat.js#L6-L154 "Source code on GitHub" [11]: https://github.com/Gmousse/dataframe-js/blob/cef738e8a8e82e94515dfc49f015f842a8c410f2/src/modules/stat.js#L29-L39 "Source code on GitHub" [12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String [13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number [14]: https://github.com/Gmousse/dataframe-js/blob/cef738e8a8e82e94515dfc49f015f842a8c410f2/src/modules/stat.js#L48-L52 "Source code on GitHub" [15]: https://github.com/Gmousse/dataframe-js/blob/cef738e8a8e82e94515dfc49f015f842a8c410f2/src/modules/stat.js#L61-L65 "Source code on GitHub" [16]: https://github.com/Gmousse/dataframe-js/blob/cef738e8a8e82e94515dfc49f015f842a8c410f2/src/modules/stat.js#L74-L87 "Source code on GitHub" [17]: https://github.com/Gmousse/dataframe-js/blob/cef738e8a8e82e94515dfc49f015f842a8c410f2/src/modules/stat.js#L97-L99 "Source code on GitHub" [18]: https://github.com/Gmousse/dataframe-js/blob/cef738e8a8e82e94515dfc49f015f842a8c410f2/src/modules/stat.js#L109-L121 "Source code on GitHub" [19]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean [20]: https://github.com/Gmousse/dataframe-js/blob/cef738e8a8e82e94515dfc49f015f842a8c410f2/src/modules/stat.js#L131-L133 "Source code on GitHub" [21]: https://github.com/Gmousse/dataframe-js/blob/cef738e8a8e82e94515dfc49f015f842a8c410f2/src/modules/stat.js#L142-L153 "Source code on GitHub" [22]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object