JSPM

ndarray-squeeze

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 96
  • Score
    100M100P100Q81397F
  • License MIT

Remove singleton dimensions from an ndarray

Package Exports

  • ndarray-squeeze

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ndarray-squeeze) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ndarray-squeeze Build Status npm version js-standard-style

Remove singleton dimensions from an ndarray

Introduction

This module takes an input ndarray and removes any dimensions with length 1 or, optionally, specified dimensions with length 1.

Examples

var ndarray = require('ndarray')
var squeeze = require('ndarray-squeeze')

squeeze(ndarray([1, 2, 3, 4], [2, 1, 1, 2, 1]))
// => ndarray([1, 2, 3, 4], [2, 2])

squeeze(ndarray([1, 2, 3, 4], [2, 1, 1, 2, 1]), [1])
// => ndarray([1, 2, 3, 4], [2, 1, 2, 1])

Installation

$ npm install ndarray-squeeze

API

require('ndarray-squeeze')(input[, axes])

Arguments:

  • input: The input ndarray to be squeezed
  • axes (optional): An Array list of dimensions to be squeezed. Non-singleton dimensions will be ignored. If not provided, all singleton dimensions will be removed.

Returns: A new array view of the squeezed ndarray (i.e. a new ndarray object with the same underlying data).

See Also

License

© 2016 Ricky Reusser. MIT License.