Socket
Socket
Sign inDemoInstall

index-align-ndarray

Package Overview
Dependencies
7
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    index-align-ndarray

Get index aligned table from nx2 tables of different length


Version published
Weekly downloads
1
Maintainers
1
Install size
99.5 kB
Created
Weekly downloads
 

Readme

Source

index-align-ndarray

Build Status

Given multiple nx2 ndarrays with a index column in ascending order, return a index aligned ndarray.

Good for aligning data based on dates, and the default behavior is to populate the new array's row if and only if there exists same index (data in first column) for all datasets provided.

e.g.

table1
10 1
12 3
15 4
20 1

table2
10 2
11 1
12 4
13 5
15 2
35 2

align([table1,table2]) ->
10 1 2
12 3 4
15 4 2

Usage

var ndarray = require('ndarray');
var align = require('index-align-ndarray');

var table1 = ndarray( new Float32Array([1,2,2,3,3,4,9,5]), [4,2], [2,1] );
var table2 = ndarray( new Float32Array([1,8,3,9,6,4,9,5]), [4,2], [2,1] );
var table3 = ndarray( new Float32Array([1,3,3,6,6,4,9,3]), [4,2], [2,1] );
var table4 = ndarray( new Float32Array([1,4,3,7,5,4,9,1]), [4,2], [2,1] );
var table5 = ndarray( new Float32Array([1,5,3,8,6,1,9,0]), [4,2], [2,1] );

var tables = [table1, table2, table3, table4, table5];
align( tables, function( err, data ) {
  // do something with returned data
});

Limitations

2-D Tables only.

Keywords

FAQs

Last updated on 02 Nov 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc