DefinitelyTyped/types/numjs/numjs-tests.ts
taoqf 322fd6daf1 fixed numjs typing bugs (#18515)
* add type definition numjs

* move ndtype from ndarry to numjs, remove unnecessary comments

* remote jsdoc annotations

* fixed: [#18508](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18508)

* add temptype to tolist

* fixed: merge Error.

* add interface TouchEvent
2017-08-02 16:13:10 -07:00

26 lines
470 B
TypeScript

import { abs } from 'numjs';
import * as nj from 'numjs';
const a = abs(2);
const arr = nj.arange(6);
arr.reshape(1, 2, 3);
// array([[[ 0, 1, 2],
// [ 3, 4, 5]]])
arr.T;
// array([[[ 0],
// [ 3]],
// [[ 1],
// [ 4]],
// [[ 2],
// [ 5]]])
arr.transpose(1, 0, 2);
// array([[[ 0, 1, 2]],
// [[ 3, 4, 5]]])
const b = nj.array([2, 3, 4]);
const c = nj.uint8([1, 2, 3]);
const d = nj.array<number[]>([[2], [3, 4]]);