scijs/ndarray-concat-rows

Name: ndarray-concat-rows

Owner: scijs

Description: Concatenate ndarrays by row (along the first dimension)

Created: 2016-01-05 14:38:26.0

Updated: 2016-12-21 01:58:08.0

Pushed: 2016-01-05 14:45:30.0

Homepage: null

Size: 8

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ndarray-concat-rows Build Status npm version js-standard-style

Concatenate ndarrays by row (along the first dimension)

Introduction

This module takes a list of input ndarrays and concatenates it along the first dimension. That is, a 3 × 2 ndarray concatenated with a 10 × 2 ndarray yields a 13 × 2 ndarray.

Examples

Understanding (+) in the comments below to indicate row concatenation,

ndarray = require('ndarray')
r = require('ndarray-concat-rows')

oncatenating vectors:
 [1 2] (+) [3 4] -> [1 2 3 4]

ndarray([1, 2]), ndarray([3, 4]) ])
> ndarray([1, 2, 3, 4])

oncatenating matrices:
                     [1  2]
 [1 2]     [5  6]    [3  4]
 [3 4] (+) [7  8] -> [4  5]
           [9 10]    [7  8]
                     [9 10]

ndarray([1, 2, 3, 4], [2, 2]), ndarray([5, 6, 7, 8, 9, 10], [3, 2]) ])
> ndarray([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [5, 2])
Installation
m install ndarray-concat-rows
API
require('ndarray-concat-rows')([output,] input, [options])

Arguments:

Returns: A reference to the output ndarray containing the concatenated data.

License

© 2016 Ricky Reusser. MIT License.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.