@stdlib/ndarray-base-dtype-chars
v0.1.1
Published
List of ndarray data type single letter character abbreviations.
Readme
dtypeChars
List of ndarray data type single letter character abbreviations.
Installation
npm install @stdlib/ndarray-base-dtype-charsUsage
var dtypeChars = require( '@stdlib/ndarray-base-dtype-chars' );dtypeChars( [kind] )
Returns a list of ndarray data type single letter character abbreviations.
var out = dtypeChars();
// e.g., returns [ 'r', 'j', 'c', 'z', ... ]When not provided a data type "kind", the function returns an array containing the single letter character abbreviations for all supported ndarray data types. To return the subset of data type single letter character abbreviations belonging to a specified data type kind, provide a kind argument.
var out = dtypeChars( 'floating_point' );
// returns [...]The function supports the following data type kinds:
floating_point: floating-point data types.real_floating_point: real-valued floating-point data types.complex_floating_point: complex-valued floating-point data types.boolean: boolean data types.integer: integer data types.signed_integer: signed integer data types.unsigned_integer: unsigned integer data types.real: real-valued data types.numeric: numeric data types.typed: typed data types.integer_index: integer index data types.boolean_index: boolean index data types.mask_index: mask index data types.typed_index: typed index data types.index: index data types.all: all data types.
Additionally, the function supports extending the "kinds" listed above by appending an _and_generic suffix to the kind name (e.g., real_and_generic).
var out = dtypeChars( 'floating_point_and_generic' );
// returns [...]Examples
var contains = require( '@stdlib/array-base-assert-contains' ).factory;
var dtypeChars = require( '@stdlib/ndarray-base-dtype-chars' );
var isdtypeChar = contains( dtypeChars() );
var bool = isdtypeChar( 'd' );
// returns true
bool = isdtypeChar( 'k' );
// returns true
bool = isdtypeChar( 'b' );
// returns true
bool = isdtypeChar( '~' );
// returns falseNotice
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.
