numpy-ts 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -15
- package/dist/numpy-ts.browser.js +2 -2
- package/dist/numpy-ts.esm.js +2 -2
- package/dist/numpy-ts.node-io.cjs +3 -2
- package/dist/numpy-ts.node-io.cjs.map +4 -4
- package/dist/numpy-ts.node-io.mjs +3 -2
- package/dist/numpy-ts.node-io.mjs.map +4 -4
- package/dist/numpy-ts.node.cjs +2 -2
- package/dist/numpy-ts.node.cjs.map +4 -4
- package/dist/types/core/ndarray.d.ts +526 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/io/index.d.ts +5 -4
- package/dist/types/io/txt/index.d.ts +12 -0
- package/dist/types/io/txt/parser.d.ts +109 -0
- package/dist/types/io/txt/serializer.d.ts +67 -0
- package/dist/types/node.d.ts +122 -0
- package/dist/types/ops/exponential.d.ts +79 -1
- package/dist/types/ops/gradient.d.ts +57 -0
- package/dist/types/ops/linalg.d.ts +220 -0
- package/dist/types/ops/rounding.d.ts +36 -0
- package/dist/types/ops/sets.d.ts +38 -0
- package/dist/types/ops/sorting.d.ts +95 -0
- package/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rounding operations
|
|
3
|
+
*
|
|
4
|
+
* Pure functions for element-wise rounding operations:
|
|
5
|
+
* around, ceil, fix, floor, rint, round, trunc
|
|
6
|
+
*/
|
|
7
|
+
import { ArrayStorage } from '../core/storage';
|
|
8
|
+
/**
|
|
9
|
+
* Round an array to the given number of decimals
|
|
10
|
+
*/
|
|
11
|
+
export declare function around(a: ArrayStorage, decimals?: number): ArrayStorage;
|
|
12
|
+
/**
|
|
13
|
+
* Return the ceiling of the input, element-wise
|
|
14
|
+
*/
|
|
15
|
+
export declare function ceil(a: ArrayStorage): ArrayStorage;
|
|
16
|
+
/**
|
|
17
|
+
* Round to nearest integer towards zero
|
|
18
|
+
*/
|
|
19
|
+
export declare function fix(a: ArrayStorage): ArrayStorage;
|
|
20
|
+
/**
|
|
21
|
+
* Return the floor of the input, element-wise
|
|
22
|
+
*/
|
|
23
|
+
export declare function floor(a: ArrayStorage): ArrayStorage;
|
|
24
|
+
/**
|
|
25
|
+
* Round elements of the array to the nearest integer (banker's rounding)
|
|
26
|
+
*/
|
|
27
|
+
export declare function rint(a: ArrayStorage): ArrayStorage;
|
|
28
|
+
/**
|
|
29
|
+
* Alias for around
|
|
30
|
+
*/
|
|
31
|
+
export declare function round(a: ArrayStorage, decimals?: number): ArrayStorage;
|
|
32
|
+
/**
|
|
33
|
+
* Return the truncated value of the input, element-wise
|
|
34
|
+
*/
|
|
35
|
+
export declare function trunc(a: ArrayStorage): ArrayStorage;
|
|
36
|
+
//# sourceMappingURL=rounding.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Set operations
|
|
3
|
+
*/
|
|
4
|
+
import { ArrayStorage } from '../core/storage';
|
|
5
|
+
/**
|
|
6
|
+
* Find the unique elements of an array
|
|
7
|
+
*/
|
|
8
|
+
export declare function unique(a: ArrayStorage, returnIndex?: boolean, returnInverse?: boolean, returnCounts?: boolean): ArrayStorage | {
|
|
9
|
+
values: ArrayStorage;
|
|
10
|
+
indices?: ArrayStorage;
|
|
11
|
+
inverse?: ArrayStorage;
|
|
12
|
+
counts?: ArrayStorage;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Test whether each element of a 1-D array is also present in a second array
|
|
16
|
+
*/
|
|
17
|
+
export declare function in1d(ar1: ArrayStorage, ar2: ArrayStorage): ArrayStorage;
|
|
18
|
+
/**
|
|
19
|
+
* Find the intersection of two arrays
|
|
20
|
+
*/
|
|
21
|
+
export declare function intersect1d(ar1: ArrayStorage, ar2: ArrayStorage): ArrayStorage;
|
|
22
|
+
/**
|
|
23
|
+
* Test whether each element of an ND array is also present in a second array
|
|
24
|
+
*/
|
|
25
|
+
export declare function isin(element: ArrayStorage, testElements: ArrayStorage): ArrayStorage;
|
|
26
|
+
/**
|
|
27
|
+
* Find the set difference of two arrays
|
|
28
|
+
*/
|
|
29
|
+
export declare function setdiff1d(ar1: ArrayStorage, ar2: ArrayStorage): ArrayStorage;
|
|
30
|
+
/**
|
|
31
|
+
* Find the set exclusive-or of two arrays
|
|
32
|
+
*/
|
|
33
|
+
export declare function setxor1d(ar1: ArrayStorage, ar2: ArrayStorage): ArrayStorage;
|
|
34
|
+
/**
|
|
35
|
+
* Find the union of two arrays
|
|
36
|
+
*/
|
|
37
|
+
export declare function union1d(ar1: ArrayStorage, ar2: ArrayStorage): ArrayStorage;
|
|
38
|
+
//# sourceMappingURL=sets.d.ts.map
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sorting and searching operations
|
|
3
|
+
*
|
|
4
|
+
* Functions for sorting arrays, finding sorted indices, and searching.
|
|
5
|
+
* @module ops/sorting
|
|
6
|
+
*/
|
|
7
|
+
import { ArrayStorage } from '../core/storage';
|
|
8
|
+
/**
|
|
9
|
+
* Return a sorted copy of an array
|
|
10
|
+
* @param storage - Input array storage
|
|
11
|
+
* @param axis - Axis along which to sort. Default is -1 (last axis)
|
|
12
|
+
* @returns Sorted array
|
|
13
|
+
*/
|
|
14
|
+
export declare function sort(storage: ArrayStorage, axis?: number): ArrayStorage;
|
|
15
|
+
/**
|
|
16
|
+
* Returns the indices that would sort an array
|
|
17
|
+
* @param storage - Input array storage
|
|
18
|
+
* @param axis - Axis along which to sort. Default is -1 (last axis)
|
|
19
|
+
* @returns Array of indices that sort the input array
|
|
20
|
+
*/
|
|
21
|
+
export declare function argsort(storage: ArrayStorage, axis?: number): ArrayStorage;
|
|
22
|
+
/**
|
|
23
|
+
* Perform an indirect stable sort using a sequence of keys
|
|
24
|
+
* @param keys - Array of ArrayStorage, the last key is the primary sort key
|
|
25
|
+
* @returns Array of indices that would sort the keys
|
|
26
|
+
*/
|
|
27
|
+
export declare function lexsort(keys: ArrayStorage[]): ArrayStorage;
|
|
28
|
+
/**
|
|
29
|
+
* Partially sort an array
|
|
30
|
+
* Returns array with element at kth position in sorted position,
|
|
31
|
+
* all smaller elements before it, all larger after it (not fully sorted)
|
|
32
|
+
* @param storage - Input array storage
|
|
33
|
+
* @param kth - Element index to partition by
|
|
34
|
+
* @param axis - Axis along which to sort. Default is -1 (last axis)
|
|
35
|
+
* @returns Partitioned array
|
|
36
|
+
*/
|
|
37
|
+
export declare function partition(storage: ArrayStorage, kth: number, axis?: number): ArrayStorage;
|
|
38
|
+
/**
|
|
39
|
+
* Returns indices that would partition an array
|
|
40
|
+
* @param storage - Input array storage
|
|
41
|
+
* @param kth - Element index to partition by
|
|
42
|
+
* @param axis - Axis along which to sort. Default is -1 (last axis)
|
|
43
|
+
* @returns Array of indices
|
|
44
|
+
*/
|
|
45
|
+
export declare function argpartition(storage: ArrayStorage, kth: number, axis?: number): ArrayStorage;
|
|
46
|
+
/**
|
|
47
|
+
* Sort a complex array using the real part first, then the imaginary part
|
|
48
|
+
* For real arrays, this is equivalent to sort
|
|
49
|
+
* @param storage - Input array storage
|
|
50
|
+
* @returns Sorted array
|
|
51
|
+
*/
|
|
52
|
+
export declare function sort_complex(storage: ArrayStorage): ArrayStorage;
|
|
53
|
+
/**
|
|
54
|
+
* Return the indices of the elements that are non-zero
|
|
55
|
+
* @param storage - Input array storage
|
|
56
|
+
* @returns Tuple of arrays, one for each dimension
|
|
57
|
+
*/
|
|
58
|
+
export declare function nonzero(storage: ArrayStorage): ArrayStorage[];
|
|
59
|
+
/**
|
|
60
|
+
* Return indices of non-zero elements in flattened array
|
|
61
|
+
* @param storage - Input array storage
|
|
62
|
+
* @returns Array of indices
|
|
63
|
+
*/
|
|
64
|
+
export declare function flatnonzero(storage: ArrayStorage): ArrayStorage;
|
|
65
|
+
/**
|
|
66
|
+
* Return elements from x or y depending on condition
|
|
67
|
+
* @param condition - Boolean array or condition
|
|
68
|
+
* @param x - Values where condition is true
|
|
69
|
+
* @param y - Values where condition is false
|
|
70
|
+
* @returns Array with elements chosen from x or y based on condition
|
|
71
|
+
*/
|
|
72
|
+
export declare function where(condition: ArrayStorage, x?: ArrayStorage, y?: ArrayStorage): ArrayStorage | ArrayStorage[];
|
|
73
|
+
/**
|
|
74
|
+
* Find indices where elements should be inserted to maintain order
|
|
75
|
+
* @param storage - Input array (must be sorted in ascending order)
|
|
76
|
+
* @param values - Values to insert
|
|
77
|
+
* @param side - 'left' or 'right' side to insert
|
|
78
|
+
* @returns Indices where values should be inserted
|
|
79
|
+
*/
|
|
80
|
+
export declare function searchsorted(storage: ArrayStorage, values: ArrayStorage, side?: 'left' | 'right'): ArrayStorage;
|
|
81
|
+
/**
|
|
82
|
+
* Return the elements of an array that satisfy some condition
|
|
83
|
+
* @param condition - Boolean array
|
|
84
|
+
* @param storage - Input array storage
|
|
85
|
+
* @returns 1D array of elements where condition is true
|
|
86
|
+
*/
|
|
87
|
+
export declare function extract(condition: ArrayStorage, storage: ArrayStorage): ArrayStorage;
|
|
88
|
+
/**
|
|
89
|
+
* Count number of non-zero values in the array
|
|
90
|
+
* @param storage - Input array storage
|
|
91
|
+
* @param axis - Axis along which to count (optional)
|
|
92
|
+
* @returns Count of non-zero values
|
|
93
|
+
*/
|
|
94
|
+
export declare function count_nonzero(storage: ArrayStorage, axis?: number): ArrayStorage | number;
|
|
95
|
+
//# sourceMappingURL=sorting.d.ts.map
|
package/package.json
CHANGED