@stdlib/ndarray-base-dtypes2strings
v0.1.1
Published
Resolve a list of data type strings.
Downloads
2,265
Readme
dtypes2strings
Resolve a list of data type strings.
Installation
npm install @stdlib/ndarray-base-dtypes2stringsUsage
var dtypes2strings = require( '@stdlib/ndarray-base-dtypes2strings' );dtypes2strings( dtypes )
Resolves a list of data type strings.
var DataType = require( '@stdlib/ndarray-dtype-ctor' );
var out = dtypes2strings( [ new DataType( 'float32' ), new DataType( 'float64' ) ] );
// returns [...]The function accepts the following arguments:
- dtypes: an array of data types.
If the function is unable to resolve a data type string for a provided data type, the corresponding element in the returned array will be null.
var out = dtypes2strings( [ 'foo', 'bar' ] );
// returns [ null, null ]Examples
var dtypes = require( '@stdlib/ndarray-dtypes' );
var logEach = require( '@stdlib/console-log-each' );
var dtypes2strings = require( '@stdlib/ndarray-base-dtypes2strings' );
// Get the list of supported data types:
var dt = dtypes();
// Resolve strings:
var strs = dtypes2strings( dt );
// Print the results:
logEach( '%s => %s', dt, strs );Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2026. The Stdlib Authors.
