UNPKG

dataframe-js

Version:

Immutable and functional data structure for datascientists and developpers

117 lines (65 loc) 2.77 kB
<!-- Generated by documentation.js. Update this documentation by updating the source code. --> ### Table of Contents - [Matrix][1] - [isCommutative][2] - [add][3] - [product][4] - [dot][5] ## Matrix [src/modules/matrix.js:8-103][6] Matrix module for DataFrame, providing basic mathematical matrix computations. **Parameters** - `df` **DataFrame** An instance of DataFrame. ### isCommutative [src/modules/matrix.js:26-34][7] Check if two DataFrames are commutative, if both have the same dimensions. **Parameters** - `df` **DataFrame** The second DataFrame to check. - `reverse` **[Boolean][8]** Revert the second DataFrame before the comparison. (optional, default `false`) **Examples** ```javascript df.matrix.isCommutative(df2) ``` Returns **[Boolean][8]** True if they are commutative, else false. ### add [src/modules/matrix.js:43-58][9] Provide an elements pairwise addition of two DataFrames having the same dimensions. **Parameters** - `df` **DataFrame** The second DataFrame to add. **Examples** ```javascript df.matrix.add(df2) ``` Returns **DataFrame** A new DataFrame resulting to the addition two DataFrames. ### product [src/modules/matrix.js:67-71][10] Provide a scalar product between a number and a DataFrame. **Parameters** - `number` **[Number][11]** The number to multiply. **Examples** ```javascript df.matrix.product(6) ``` Returns **DataFrame** A new DataFrame resulting to the scalar product. ### dot [src/modules/matrix.js:80-102][12] Multiply one DataFrame n x p and a second p x n. **Parameters** - `df` **DataFrame** The second DataFrame to multiply. **Examples** ```javascript df.matrix.dot(df) ``` Returns **DataFrame** A new n x n DataFrame resulting to the product of two DataFrame. [1]: #matrix [2]: #iscommutative [3]: #add [4]: #product [5]: #dot [6]: https://github.com/Gmousse/dataframe-js/blob/cef738e8a8e82e94515dfc49f015f842a8c410f2/src/modules/matrix.js#L8-L103 "Source code on GitHub" [7]: https://github.com/Gmousse/dataframe-js/blob/cef738e8a8e82e94515dfc49f015f842a8c410f2/src/modules/matrix.js#L26-L34 "Source code on GitHub" [8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean [9]: https://github.com/Gmousse/dataframe-js/blob/cef738e8a8e82e94515dfc49f015f842a8c410f2/src/modules/matrix.js#L43-L58 "Source code on GitHub" [10]: https://github.com/Gmousse/dataframe-js/blob/cef738e8a8e82e94515dfc49f015f842a8c410f2/src/modules/matrix.js#L67-L71 "Source code on GitHub" [11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number [12]: https://github.com/Gmousse/dataframe-js/blob/cef738e8a8e82e94515dfc49f015f842a8c410f2/src/modules/matrix.js#L80-L102 "Source code on GitHub"