Git Product home page Git Product logo

ndarray-squeeze's Introduction

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.

ndarray-squeeze's People

Contributors

rreusser avatar

Stargazers

Jae-woo Kim avatar  avatar

Watchers

Kyle Robinson Young avatar Mikola Lysenko avatar Dmitry Iv. avatar Hugh Kennedy avatar  avatar James Cloos avatar Philipp Burckhardt avatar Yosh avatar Athan avatar Jasper van de Gronde avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.