numpy-ts 0.12.0 → 0.13.1

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.
Files changed (144) hide show
  1. package/README.md +18 -14
  2. package/dist/esm/common/broadcasting.js +1 -0
  3. package/dist/esm/common/complex.js +1 -0
  4. package/dist/esm/common/dtype.js +1 -0
  5. package/dist/esm/common/internal/compute.js +1 -0
  6. package/dist/esm/common/internal/indexing.js +1 -0
  7. package/dist/esm/common/ndarray-core.js +1 -0
  8. package/dist/esm/common/ops/advanced.js +1 -0
  9. package/dist/esm/common/ops/arithmetic.js +1 -0
  10. package/dist/esm/common/ops/bitwise.js +1 -0
  11. package/dist/esm/common/ops/comparison.js +1 -0
  12. package/dist/esm/common/ops/complex.js +1 -0
  13. package/dist/esm/common/ops/exponential.js +1 -0
  14. package/dist/esm/common/ops/fft.js +1 -0
  15. package/dist/esm/common/ops/formatting.js +4 -0
  16. package/dist/esm/common/ops/gradient.js +1 -0
  17. package/dist/esm/common/ops/hyperbolic.js +1 -0
  18. package/dist/esm/common/ops/linalg.js +2 -0
  19. package/dist/esm/common/ops/logic.js +1 -0
  20. package/dist/esm/common/ops/random.js +1 -0
  21. package/dist/esm/common/ops/reduction.js +1 -0
  22. package/dist/esm/common/ops/rounding.js +1 -0
  23. package/dist/esm/common/ops/sets.js +1 -0
  24. package/dist/esm/common/ops/shape.js +1 -0
  25. package/dist/esm/common/ops/sorting.js +1 -0
  26. package/dist/esm/common/ops/statistics.js +1 -0
  27. package/dist/esm/common/ops/trig.js +1 -0
  28. package/dist/esm/common/slicing.js +1 -0
  29. package/dist/esm/common/storage.js +1 -0
  30. package/dist/esm/core/advanced.js +1 -0
  31. package/dist/esm/core/arithmetic.js +1 -0
  32. package/dist/esm/core/bitwise.js +1 -0
  33. package/dist/esm/core/complex.js +1 -0
  34. package/dist/esm/core/creation.js +1 -0
  35. package/dist/esm/core/formatting.js +1 -0
  36. package/dist/esm/core/gradient.js +1 -0
  37. package/dist/esm/core/index.js +1 -0
  38. package/dist/esm/core/linalg.js +1 -0
  39. package/dist/esm/core/logic.js +1 -0
  40. package/dist/esm/core/polynomial.js +1 -0
  41. package/dist/esm/core/reduction.js +1 -0
  42. package/dist/esm/core/rounding.js +1 -0
  43. package/dist/esm/core/sets.js +1 -0
  44. package/dist/esm/core/shape-extra.js +1 -0
  45. package/dist/esm/core/shape.js +1 -0
  46. package/dist/esm/core/sorting.js +1 -0
  47. package/dist/esm/core/statistics.js +1 -0
  48. package/dist/esm/core/trig.js +1 -0
  49. package/dist/esm/core/typechecking.js +1 -0
  50. package/dist/esm/core/types.js +1 -0
  51. package/dist/esm/core/utility.js +1 -0
  52. package/dist/esm/core.js +1 -0
  53. package/dist/esm/full/index.js +1 -0
  54. package/dist/esm/full/ndarray.js +1 -0
  55. package/dist/esm/index.js +1 -0
  56. package/dist/esm/io/index.js +1 -0
  57. package/dist/esm/io/npy/format.js +1 -0
  58. package/dist/esm/io/npy/index.js +1 -0
  59. package/dist/esm/io/npy/parser.js +1 -0
  60. package/dist/esm/io/npy/serializer.js +2 -0
  61. package/dist/esm/io/npz/index.js +1 -0
  62. package/dist/esm/io/npz/parser.js +1 -0
  63. package/dist/esm/io/npz/serializer.js +1 -0
  64. package/dist/esm/io/txt/index.js +1 -0
  65. package/dist/esm/io/txt/parser.js +1 -0
  66. package/dist/esm/io/txt/serializer.js +2 -0
  67. package/dist/esm/io/zip/index.js +1 -0
  68. package/dist/esm/io/zip/reader.js +1 -0
  69. package/dist/esm/io/zip/types.js +1 -0
  70. package/dist/esm/io/zip/writer.js +1 -0
  71. package/dist/esm/node.js +1 -0
  72. package/dist/numpy-ts.browser.js +7 -2
  73. package/dist/numpy-ts.node-io.cjs +7 -3
  74. package/dist/numpy-ts.node-io.cjs.map +4 -4
  75. package/dist/numpy-ts.node-io.mjs +7 -3
  76. package/dist/numpy-ts.node-io.mjs.map +4 -4
  77. package/dist/numpy-ts.node.cjs +7 -2
  78. package/dist/numpy-ts.node.cjs.map +4 -4
  79. package/dist/types/common/complex.d.ts +94 -0
  80. package/dist/types/{internal → common/internal}/compute.d.ts +1 -1
  81. package/dist/types/{internal → common/internal}/indexing.d.ts +6 -0
  82. package/dist/types/common/ndarray-core.d.ts +126 -0
  83. package/dist/types/{ops → common/ops}/advanced.d.ts +2 -2
  84. package/dist/types/{ops → common/ops}/arithmetic.d.ts +1 -1
  85. package/dist/types/{ops → common/ops}/bitwise.d.ts +1 -1
  86. package/dist/types/{ops → common/ops}/comparison.d.ts +1 -1
  87. package/dist/types/{ops → common/ops}/complex.d.ts +1 -1
  88. package/dist/types/{ops → common/ops}/exponential.d.ts +1 -1
  89. package/dist/types/common/ops/fft.d.ts +166 -0
  90. package/dist/types/common/ops/formatting.d.ts +229 -0
  91. package/dist/types/{ops → common/ops}/gradient.d.ts +1 -1
  92. package/dist/types/{ops → common/ops}/hyperbolic.d.ts +1 -1
  93. package/dist/types/{ops → common/ops}/linalg.d.ts +24 -3
  94. package/dist/types/{ops → common/ops}/logic.d.ts +2 -2
  95. package/dist/types/common/ops/random.d.ts +376 -0
  96. package/dist/types/{ops → common/ops}/reduction.d.ts +2 -2
  97. package/dist/types/{ops → common/ops}/rounding.d.ts +1 -1
  98. package/dist/types/{ops → common/ops}/sets.d.ts +1 -1
  99. package/dist/types/{ops → common/ops}/shape.d.ts +1 -1
  100. package/dist/types/{ops → common/ops}/sorting.d.ts +1 -1
  101. package/dist/types/{ops → common/ops}/statistics.d.ts +1 -1
  102. package/dist/types/{ops → common/ops}/trig.d.ts +1 -1
  103. package/dist/types/{core → common}/storage.d.ts +1 -0
  104. package/dist/types/core/advanced.d.ts +54 -0
  105. package/dist/types/core/arithmetic.d.ts +110 -0
  106. package/dist/types/core/bitwise.d.ts +34 -0
  107. package/dist/types/core/complex.d.ts +15 -90
  108. package/dist/types/core/creation.d.ts +98 -0
  109. package/dist/types/core/formatting.d.ts +29 -0
  110. package/dist/types/core/gradient.d.ts +14 -0
  111. package/dist/types/core/index.d.ts +40 -0
  112. package/dist/types/core/linalg.d.ts +141 -0
  113. package/dist/types/core/logic.d.ts +72 -0
  114. package/dist/types/core/polynomial.d.ts +50 -0
  115. package/dist/types/core/reduction.d.ts +82 -0
  116. package/dist/types/core/rounding.d.ts +24 -0
  117. package/dist/types/core/sets.d.ts +48 -0
  118. package/dist/types/core/shape-extra.d.ts +24 -0
  119. package/dist/types/core/shape.d.ts +77 -0
  120. package/dist/types/core/sorting.d.ts +34 -0
  121. package/dist/types/core/statistics.d.ts +32 -0
  122. package/dist/types/core/trig.d.ts +58 -0
  123. package/dist/types/core/typechecking.d.ts +50 -0
  124. package/dist/types/core/types.d.ts +43 -0
  125. package/dist/types/core/utility.d.ts +30 -0
  126. package/dist/types/core.d.ts +30 -0
  127. package/dist/types/full/index.d.ts +603 -0
  128. package/dist/types/full/ndarray.d.ts +880 -0
  129. package/dist/types/index.d.ts +140 -26
  130. package/dist/types/io/npy/format.d.ts +1 -1
  131. package/dist/types/io/npy/parser.d.ts +3 -3
  132. package/dist/types/io/npy/serializer.d.ts +2 -2
  133. package/dist/types/io/npz/parser.d.ts +4 -4
  134. package/dist/types/io/npz/serializer.d.ts +6 -6
  135. package/dist/types/io/txt/parser.d.ts +5 -5
  136. package/dist/types/io/txt/serializer.d.ts +2 -2
  137. package/dist/types/node.d.ts +12 -8
  138. package/package.json +30 -29
  139. package/dist/numpy-ts.esm.js +0 -2
  140. package/dist/types/core/ndarray.d.ts +0 -3923
  141. package/dist/types/ops/random.d.ts +0 -136
  142. /package/dist/types/{core → common}/broadcasting.d.ts +0 -0
  143. /package/dist/types/{core → common}/dtype.d.ts +0 -0
  144. /package/dist/types/{core → common}/slicing.d.ts +0 -0
@@ -0,0 +1,880 @@
1
+ import { type DType } from '../common/dtype';
2
+ import { Complex } from '../common/complex';
3
+ import { ArrayStorage } from '../common/storage';
4
+ import { NDArrayCore } from '../common/ndarray-core';
5
+ export declare class NDArray extends NDArrayCore {
6
+ /**
7
+ * Override _base with NDArray type
8
+ */
9
+ protected _base?: NDArray;
10
+ constructor(storage: ArrayStorage, base?: NDArray);
11
+ /**
12
+ * Create NDArray from storage (for ops modules)
13
+ * @internal
14
+ */
15
+ static fromStorage(storage: ArrayStorage, base?: NDArray): NDArray;
16
+ /**
17
+ * Base array if this is a view, null if this array owns its data
18
+ * Similar to NumPy's base attribute
19
+ */
20
+ get base(): NDArray | null;
21
+ /**
22
+ * Transpose of the array (shorthand for transpose())
23
+ * Returns a view with axes reversed
24
+ */
25
+ get T(): NDArray;
26
+ /**
27
+ * Size of one array element in bytes
28
+ */
29
+ get itemsize(): number;
30
+ /**
31
+ * Total bytes consumed by the elements of the array
32
+ */
33
+ get nbytes(): number;
34
+ /**
35
+ * Fill the array with a scalar value (in-place)
36
+ * @param value - Value to fill with
37
+ */
38
+ fill(value: number | bigint): void;
39
+ /**
40
+ * Iterator protocol - iterate over the first axis
41
+ * For 1D arrays, yields elements; for ND arrays, yields (N-1)D subarrays
42
+ */
43
+ [Symbol.iterator](): Iterator<NDArray | number | bigint | Complex>;
44
+ /**
45
+ * Get a single element from the array
46
+ * @param indices - Array of indices, one per dimension
47
+ * @returns The element value
48
+ */
49
+ get(indices: number[]): number | bigint | Complex;
50
+ /**
51
+ * Set a single element in the array
52
+ * @param indices - Array of indices, one per dimension
53
+ * @param value - Value to set
54
+ */
55
+ set(indices: number[], value: number | bigint | Complex | {
56
+ re: number;
57
+ im: number;
58
+ }): void;
59
+ /**
60
+ * Return a deep copy of the array
61
+ */
62
+ copy(): NDArray;
63
+ /**
64
+ * Cast array to a different dtype
65
+ * @param dtype - Target dtype
66
+ * @param copy - If false and dtype matches, return self
67
+ * @returns Array with specified dtype
68
+ */
69
+ astype(dtype: DType, copy?: boolean): NDArray;
70
+ /**
71
+ * Slice the array using NumPy-style string syntax
72
+ * @param sliceStrs - Slice specifications, one per dimension
73
+ * @returns Sliced view of the array
74
+ */
75
+ slice(...sliceStrs: string[]): NDArray;
76
+ /**
77
+ * Get a single row (convenience method)
78
+ * @param i - Row index
79
+ * @returns Row as 1D or (n-1)D array
80
+ */
81
+ row(i: number): NDArray;
82
+ /**
83
+ * Get a single column (convenience method)
84
+ * @param j - Column index
85
+ * @returns Column as 1D or (n-1)D array
86
+ */
87
+ col(j: number): NDArray;
88
+ /**
89
+ * Get a range of rows (convenience method)
90
+ * @param start - Start row index
91
+ * @param stop - Stop row index (exclusive)
92
+ * @returns Rows as array
93
+ */
94
+ rows(start: number, stop: number): NDArray;
95
+ /**
96
+ * Get a range of columns (convenience method)
97
+ * @param start - Start column index
98
+ * @param stop - Stop column index (exclusive)
99
+ * @returns Columns as array
100
+ */
101
+ cols(start: number, stop: number): NDArray;
102
+ /**
103
+ * Reshape array to a new shape
104
+ * Returns a new array with the specified shape
105
+ * @param shape - New shape (must be compatible with current size)
106
+ * @returns Reshaped array
107
+ */
108
+ reshape(...shape: number[]): NDArray;
109
+ /**
110
+ * Return a flattened array (view when possible, otherwise copy)
111
+ * @returns 1D array containing all elements
112
+ */
113
+ ravel(): NDArray;
114
+ /**
115
+ * Put values at specified indices (modifies array in-place)
116
+ * @param indices - Indices at which to place values
117
+ * @param values - Values to put
118
+ */
119
+ put(indices: number[], values: NDArray | number | bigint): void;
120
+ /**
121
+ * Return selected slices of this array along given axis
122
+ * @param condition - Boolean array that selects which entries to return
123
+ * @param axis - Axis along which to take slices
124
+ * @returns Array with selected entries
125
+ */
126
+ compress(condition: NDArray | boolean[], axis?: number): NDArray;
127
+ /**
128
+ * Construct an array from an index array and a list of arrays to choose from
129
+ * @param choices - Array of NDArrays to choose from
130
+ * @returns New array with selected elements
131
+ */
132
+ choose(choices: NDArray[]): NDArray;
133
+ /**
134
+ * Clip (limit) the values in an array
135
+ * @param a_min - Minimum value (null for no minimum)
136
+ * @param a_max - Maximum value (null for no maximum)
137
+ * @returns Array with values clipped to [a_min, a_max]
138
+ */
139
+ clip(a_min: number | NDArray | null, a_max: number | NDArray | null): NDArray;
140
+ /**
141
+ * Integer array indexing (fancy indexing)
142
+ *
143
+ * Select elements using an array of indices.
144
+ * @param indices - Array of integer indices
145
+ * @param axis - Axis along which to index (default: 0)
146
+ * @returns New array with selected elements
147
+ */
148
+ iindex(indices: NDArray | number[] | number[][], axis?: number): NDArray;
149
+ /**
150
+ * Boolean array indexing (fancy indexing with mask)
151
+ *
152
+ * Select elements where a boolean mask is true.
153
+ * @param mask - Boolean NDArray mask
154
+ * @param axis - Axis along which to apply the mask
155
+ * @returns New 1D array with selected elements
156
+ */
157
+ bindex(mask: NDArray, axis?: number): NDArray;
158
+ /**
159
+ * String representation of the array
160
+ * @returns String describing the array shape and dtype
161
+ */
162
+ toString(): string;
163
+ /**
164
+ * Convert to nested JavaScript array
165
+ * @returns Nested JavaScript array representation
166
+ */
167
+ toArray(): any;
168
+ /**
169
+ * Return the array as a nested list (same as toArray)
170
+ */
171
+ tolist(): any;
172
+ /**
173
+ * Return the raw bytes of the array data
174
+ */
175
+ tobytes(): ArrayBuffer;
176
+ /**
177
+ * Copy an element of an array to a standard scalar and return it
178
+ */
179
+ item(...args: number[]): number | bigint | Complex;
180
+ /**
181
+ * Swap the bytes of the array elements
182
+ */
183
+ byteswap(inplace?: boolean): NDArray;
184
+ /**
185
+ * Return a view of the array with a different dtype
186
+ */
187
+ view(dtype?: DType): NDArray;
188
+ /**
189
+ * Write array to a file (stub)
190
+ */
191
+ tofile(_file: string, _sep?: string, _format?: string): void;
192
+ /**
193
+ * Round an array to the given number of decimals (alias for around)
194
+ * @param decimals - Number of decimal places to round to (default: 0)
195
+ * @returns New array with rounded values
196
+ */
197
+ round(decimals?: number): NDArray;
198
+ /**
199
+ * Return the complex conjugate, element-wise (alias for conj)
200
+ * @returns Complex conjugate of the array
201
+ */
202
+ conjugate(): NDArray;
203
+ /**
204
+ * Round an array to the given number of decimals
205
+ * @param decimals - Number of decimal places to round to (default: 0)
206
+ * @returns New array with rounded values
207
+ */
208
+ around(decimals?: number): NDArray;
209
+ /**
210
+ * Element-wise comparison with tolerance
211
+ * Returns True where |a - b| <= (atol + rtol * |b|)
212
+ * @param other - Value or array to compare with
213
+ * @param rtol - Relative tolerance (default: 1e-5)
214
+ * @param atol - Absolute tolerance (default: 1e-8)
215
+ * @returns boolean
216
+ */
217
+ allclose(other: NDArray | number, rtol?: number, atol?: number): boolean;
218
+ /**
219
+ * Element-wise comparison with tolerance
220
+ * Returns True where |a - b| <= (atol + rtol * |b|)
221
+ * @param other - Value or array to compare with
222
+ * @param rtol - Relative tolerance (default: 1e-5)
223
+ * @param atol - Absolute tolerance (default: 1e-8)
224
+ * @returns Boolean array
225
+ */
226
+ isclose(other: NDArray | number, rtol?: number, atol?: number): NDArray;
227
+ /**
228
+ * Compute the weighted average along the specified axis
229
+ * @param weights - Array of weights (optional)
230
+ * @param axis - Axis along which to compute average
231
+ * @returns Weighted average of array elements
232
+ */
233
+ average(weights?: NDArray, axis?: number): NDArray | number | Complex;
234
+ /**
235
+ * Dot product (matching NumPy behavior)
236
+ * @param other - Array to dot with
237
+ * @returns Result of dot product
238
+ */
239
+ dot(other: NDArray): NDArray | number | bigint | Complex;
240
+ /**
241
+ * Sum of diagonal elements (trace)
242
+ * @returns Sum of diagonal elements
243
+ */
244
+ trace(): number | bigint | Complex;
245
+ /**
246
+ * Inner product (contracts over last axes of both arrays)
247
+ * @param other - Array to compute inner product with
248
+ * @returns Inner product result
249
+ */
250
+ inner(other: NDArray): NDArray | number | bigint | Complex;
251
+ /**
252
+ * Tensor dot product along specified axes
253
+ * @param other - Array to contract with
254
+ * @param axes - Axes to contract
255
+ * @returns Tensor dot product result
256
+ */
257
+ tensordot(other: NDArray, axes?: number | [number[], number[]]): NDArray | number | bigint | Complex;
258
+ /**
259
+ * Returns both quotient and remainder (floor divide and modulo)
260
+ * @param divisor - Array or scalar divisor
261
+ * @returns Tuple of [quotient, remainder] arrays
262
+ */
263
+ divmod(divisor: NDArray | number): [NDArray, NDArray];
264
+ /**
265
+ * Find indices where elements should be inserted to maintain order
266
+ * @param v - Values to insert
267
+ * @param side - "left" or "right" side to insert
268
+ * @returns Indices where values should be inserted
269
+ */
270
+ searchsorted(v: NDArray, side?: 'left' | 'right'): NDArray;
271
+ /**
272
+ * Square root of each element
273
+ * Promotes integer types to float64
274
+ */
275
+ sqrt(): NDArray;
276
+ /**
277
+ * Natural exponential (e^x) of each element
278
+ * Promotes integer types to float64
279
+ */
280
+ exp(): NDArray;
281
+ /**
282
+ * Base-2 exponential (2^x) of each element
283
+ * Promotes integer types to float64
284
+ */
285
+ exp2(): NDArray;
286
+ /**
287
+ * Exponential minus one (e^x - 1) of each element
288
+ * More accurate than exp(x) - 1 for small x
289
+ */
290
+ expm1(): NDArray;
291
+ /**
292
+ * Natural logarithm (ln) of each element
293
+ * Promotes integer types to float64
294
+ */
295
+ log(): NDArray;
296
+ /**
297
+ * Base-2 logarithm of each element
298
+ * Promotes integer types to float64
299
+ */
300
+ log2(): NDArray;
301
+ /**
302
+ * Base-10 logarithm of each element
303
+ * Promotes integer types to float64
304
+ */
305
+ log10(): NDArray;
306
+ /**
307
+ * Natural logarithm of (1 + x) of each element
308
+ * More accurate than log(1 + x) for small x
309
+ */
310
+ log1p(): NDArray;
311
+ /**
312
+ * Absolute value of each element
313
+ */
314
+ absolute(): NDArray;
315
+ /**
316
+ * Numerical negative (element-wise negation)
317
+ */
318
+ negative(): NDArray;
319
+ /**
320
+ * Sign of each element (-1, 0, or 1)
321
+ */
322
+ sign(): NDArray;
323
+ /**
324
+ * Numerical positive (element-wise +x)
325
+ * @returns Copy of the array
326
+ */
327
+ positive(): NDArray;
328
+ /**
329
+ * Element-wise reciprocal (1/x)
330
+ */
331
+ reciprocal(): NDArray;
332
+ /**
333
+ * Return the ceiling of the input, element-wise
334
+ */
335
+ ceil(): NDArray;
336
+ /**
337
+ * Round to nearest integer towards zero
338
+ */
339
+ fix(): NDArray;
340
+ /**
341
+ * Return the floor of the input, element-wise
342
+ */
343
+ floor(): NDArray;
344
+ /**
345
+ * Round elements to the nearest integer
346
+ */
347
+ rint(): NDArray;
348
+ /**
349
+ * Return the truncated value of the input, element-wise
350
+ */
351
+ trunc(): NDArray;
352
+ /**
353
+ * Sine of each element (in radians)
354
+ * Promotes integer types to float64
355
+ */
356
+ sin(): NDArray;
357
+ /**
358
+ * Cosine of each element (in radians)
359
+ * Promotes integer types to float64
360
+ */
361
+ cos(): NDArray;
362
+ /**
363
+ * Tangent of each element (in radians)
364
+ * Promotes integer types to float64
365
+ */
366
+ tan(): NDArray;
367
+ /**
368
+ * Inverse sine of each element
369
+ * Promotes integer types to float64
370
+ */
371
+ arcsin(): NDArray;
372
+ /**
373
+ * Inverse cosine of each element
374
+ * Promotes integer types to float64
375
+ */
376
+ arccos(): NDArray;
377
+ /**
378
+ * Inverse tangent of each element
379
+ * Promotes integer types to float64
380
+ */
381
+ arctan(): NDArray;
382
+ /**
383
+ * Convert angles from radians to degrees
384
+ */
385
+ degrees(): NDArray;
386
+ /**
387
+ * Convert angles from degrees to radians
388
+ */
389
+ radians(): NDArray;
390
+ /**
391
+ * Hyperbolic sine of each element
392
+ * Promotes integer types to float64
393
+ */
394
+ sinh(): NDArray;
395
+ /**
396
+ * Hyperbolic cosine of each element
397
+ * Promotes integer types to float64
398
+ */
399
+ cosh(): NDArray;
400
+ /**
401
+ * Hyperbolic tangent of each element
402
+ * Promotes integer types to float64
403
+ */
404
+ tanh(): NDArray;
405
+ /**
406
+ * Inverse hyperbolic sine of each element
407
+ * Promotes integer types to float64
408
+ */
409
+ arcsinh(): NDArray;
410
+ /**
411
+ * Inverse hyperbolic cosine of each element
412
+ * Promotes integer types to float64
413
+ */
414
+ arccosh(): NDArray;
415
+ /**
416
+ * Inverse hyperbolic tangent of each element
417
+ * Promotes integer types to float64
418
+ */
419
+ arctanh(): NDArray;
420
+ /**
421
+ * Bitwise NOT (inversion) element-wise
422
+ */
423
+ bitwise_not(): NDArray;
424
+ /**
425
+ * Invert (bitwise NOT) element-wise - alias for bitwise_not
426
+ */
427
+ invert(): NDArray;
428
+ /**
429
+ * Logical NOT element-wise
430
+ * @returns Boolean array (1 = true, 0 = false)
431
+ */
432
+ logical_not(): NDArray;
433
+ /**
434
+ * Test element-wise for finiteness (not infinity and not NaN)
435
+ */
436
+ isfinite(): NDArray;
437
+ /**
438
+ * Test element-wise for positive or negative infinity
439
+ */
440
+ isinf(): NDArray;
441
+ /**
442
+ * Test element-wise for NaN (Not a Number)
443
+ */
444
+ isnan(): NDArray;
445
+ /**
446
+ * Test element-wise for NaT (Not a Time)
447
+ * @returns Boolean array (always false without datetime support)
448
+ */
449
+ isnat(): NDArray;
450
+ /**
451
+ * Returns element-wise True where signbit is set (less than zero)
452
+ */
453
+ signbit(): NDArray;
454
+ /**
455
+ * Return the distance between x and the nearest adjacent number
456
+ */
457
+ spacing(): NDArray;
458
+ /**
459
+ * Element-wise cube root
460
+ * Promotes integer types to float64
461
+ */
462
+ cbrt(): NDArray;
463
+ /**
464
+ * Element-wise absolute value (always returns float)
465
+ */
466
+ fabs(): NDArray;
467
+ /**
468
+ * Element-wise square (x**2)
469
+ */
470
+ square(): NDArray;
471
+ /**
472
+ * Return the complex conjugate, element-wise
473
+ */
474
+ conj(): NDArray;
475
+ /**
476
+ * Return a flattened copy of the array
477
+ * @returns 1D array containing all elements
478
+ */
479
+ flatten(): NDArray;
480
+ /**
481
+ * Find the indices of array elements that are non-zero, grouped by element
482
+ * @returns 2D array of shape (N, ndim)
483
+ */
484
+ argwhere(): NDArray;
485
+ /**
486
+ * Element-wise addition
487
+ * @param other - Array or scalar to add
488
+ */
489
+ add(other: NDArray | number): NDArray;
490
+ /**
491
+ * Element-wise subtraction
492
+ * @param other - Array or scalar to subtract
493
+ */
494
+ subtract(other: NDArray | number): NDArray;
495
+ /**
496
+ * Element-wise multiplication
497
+ * @param other - Array or scalar to multiply
498
+ */
499
+ multiply(other: NDArray | number): NDArray;
500
+ /**
501
+ * Element-wise division
502
+ * @param other - Array or scalar to divide by
503
+ */
504
+ divide(other: NDArray | number): NDArray;
505
+ /**
506
+ * Element-wise modulo operation
507
+ * @param other - Array or scalar divisor
508
+ */
509
+ mod(other: NDArray | number): NDArray;
510
+ /**
511
+ * Element-wise floor division
512
+ * @param other - Array or scalar to divide by
513
+ */
514
+ floor_divide(other: NDArray | number): NDArray;
515
+ /**
516
+ * Raise elements to power
517
+ * @param exponent - Power to raise to (array or scalar)
518
+ */
519
+ power(exponent: NDArray | number): NDArray;
520
+ /**
521
+ * Logarithm of the sum of exponentials: log(exp(x1) + exp(x2))
522
+ * @param x2 - Second operand
523
+ */
524
+ logaddexp(x2: NDArray | number): NDArray;
525
+ /**
526
+ * Logarithm base 2 of the sum of exponentials: log2(2^x1 + 2^x2)
527
+ * @param x2 - Second operand
528
+ */
529
+ logaddexp2(x2: NDArray | number): NDArray;
530
+ /**
531
+ * Element-wise arc tangent of this/other choosing the quadrant correctly
532
+ * @param other - x-coordinates
533
+ */
534
+ arctan2(other: NDArray | number): NDArray;
535
+ /**
536
+ * Given the "legs" of a right triangle, return its hypotenuse
537
+ * @param other - Second leg
538
+ */
539
+ hypot(other: NDArray | number): NDArray;
540
+ /**
541
+ * Element-wise greater than comparison
542
+ * @returns Boolean array
543
+ */
544
+ greater(other: NDArray | number): NDArray;
545
+ /**
546
+ * Element-wise greater than or equal comparison
547
+ * @returns Boolean array
548
+ */
549
+ greater_equal(other: NDArray | number): NDArray;
550
+ /**
551
+ * Element-wise less than comparison
552
+ * @returns Boolean array
553
+ */
554
+ less(other: NDArray | number): NDArray;
555
+ /**
556
+ * Element-wise less than or equal comparison
557
+ * @returns Boolean array
558
+ */
559
+ less_equal(other: NDArray | number): NDArray;
560
+ /**
561
+ * Element-wise equality comparison
562
+ * @returns Boolean array
563
+ */
564
+ equal(other: NDArray | number): NDArray;
565
+ /**
566
+ * Element-wise not equal comparison
567
+ * @returns Boolean array
568
+ */
569
+ not_equal(other: NDArray | number): NDArray;
570
+ /**
571
+ * Bitwise AND element-wise
572
+ * @param other - Array or scalar (must be integer type)
573
+ */
574
+ bitwise_and(other: NDArray | number): NDArray;
575
+ /**
576
+ * Bitwise OR element-wise
577
+ * @param other - Array or scalar (must be integer type)
578
+ */
579
+ bitwise_or(other: NDArray | number): NDArray;
580
+ /**
581
+ * Bitwise XOR element-wise
582
+ * @param other - Array or scalar (must be integer type)
583
+ */
584
+ bitwise_xor(other: NDArray | number): NDArray;
585
+ /**
586
+ * Left shift elements by positions
587
+ * @param shift - Shift amount
588
+ */
589
+ left_shift(shift: NDArray | number): NDArray;
590
+ /**
591
+ * Right shift elements by positions
592
+ * @param shift - Shift amount
593
+ */
594
+ right_shift(shift: NDArray | number): NDArray;
595
+ /**
596
+ * Logical AND element-wise
597
+ * @returns Boolean array (1 = true, 0 = false)
598
+ */
599
+ logical_and(other: NDArray | number): NDArray;
600
+ /**
601
+ * Logical OR element-wise
602
+ * @returns Boolean array (1 = true, 0 = false)
603
+ */
604
+ logical_or(other: NDArray | number): NDArray;
605
+ /**
606
+ * Logical XOR element-wise
607
+ * @returns Boolean array (1 = true, 0 = false)
608
+ */
609
+ logical_xor(other: NDArray | number): NDArray;
610
+ /**
611
+ * Change the sign of x1 to that of x2, element-wise
612
+ * @param x2 - Values whose sign is used
613
+ */
614
+ copysign(x2: NDArray | number): NDArray;
615
+ /**
616
+ * Return the next floating-point value after x1 towards x2, element-wise
617
+ * @param x2 - Direction to look
618
+ */
619
+ nextafter(x2: NDArray | number): NDArray;
620
+ /**
621
+ * Element-wise remainder (same as mod)
622
+ * @param divisor - Array or scalar divisor
623
+ */
624
+ remainder(divisor: NDArray | number): NDArray;
625
+ /**
626
+ * Heaviside step function
627
+ * @param x2 - Value to use when this array element is 0
628
+ */
629
+ heaviside(x2: NDArray | number): NDArray;
630
+ /**
631
+ * Matrix multiplication
632
+ * @param other - Array to multiply with
633
+ */
634
+ matmul(other: NDArray): NDArray;
635
+ /**
636
+ * Outer product (flattens inputs then computes a[i]*b[j])
637
+ * @param other - Array to compute outer product with
638
+ */
639
+ outer(other: NDArray): NDArray;
640
+ /**
641
+ * Sum array elements over a given axis
642
+ */
643
+ sum(axis?: number, keepdims?: boolean): NDArray | number | bigint | Complex;
644
+ /**
645
+ * Compute the arithmetic mean along the specified axis
646
+ */
647
+ mean(axis?: number, keepdims?: boolean): NDArray | number | Complex;
648
+ /**
649
+ * Product of array elements over a given axis
650
+ */
651
+ prod(axis?: number, keepdims?: boolean): NDArray | number | bigint | Complex;
652
+ /**
653
+ * Return the maximum along a given axis
654
+ */
655
+ max(axis?: number, keepdims?: boolean): NDArray | number | Complex;
656
+ /**
657
+ * Return the minimum along a given axis
658
+ */
659
+ min(axis?: number, keepdims?: boolean): NDArray | number | Complex;
660
+ /**
661
+ * Peak to peak (maximum - minimum) value along a given axis
662
+ */
663
+ ptp(axis?: number, keepdims?: boolean): NDArray | number | Complex;
664
+ /**
665
+ * Return the sum of array elements, treating NaNs as zero
666
+ */
667
+ nansum(axis?: number, keepdims?: boolean): NDArray | number | Complex;
668
+ /**
669
+ * Return the product of array elements, treating NaNs as ones
670
+ */
671
+ nanprod(axis?: number, keepdims?: boolean): NDArray | number | Complex;
672
+ /**
673
+ * Compute the arithmetic mean, ignoring NaNs
674
+ */
675
+ nanmean(axis?: number, keepdims?: boolean): NDArray | number | Complex;
676
+ /**
677
+ * Return minimum of an array, ignoring NaNs
678
+ */
679
+ nanmin(axis?: number, keepdims?: boolean): NDArray | number | Complex;
680
+ /**
681
+ * Return maximum of an array, ignoring NaNs
682
+ */
683
+ nanmax(axis?: number, keepdims?: boolean): NDArray | number | Complex;
684
+ /**
685
+ * Indices of the minimum values along an axis
686
+ */
687
+ argmin(axis?: number): NDArray | number;
688
+ /**
689
+ * Indices of the maximum values along an axis
690
+ */
691
+ argmax(axis?: number): NDArray | number;
692
+ /**
693
+ * Return the indices of the minimum values, ignoring NaNs
694
+ */
695
+ nanargmin(axis?: number): NDArray | number;
696
+ /**
697
+ * Return the indices of the maximum values, ignoring NaNs
698
+ */
699
+ nanargmax(axis?: number): NDArray | number;
700
+ /**
701
+ * Compute variance along the specified axis
702
+ * @param axis - Axis along which to compute variance
703
+ * @param ddof - Delta degrees of freedom (default: 0)
704
+ * @param keepdims - If true, reduced axes are left as dimensions with size 1
705
+ */
706
+ var(axis?: number, ddof?: number, keepdims?: boolean): NDArray | number;
707
+ /**
708
+ * Compute standard deviation along the specified axis
709
+ * @param axis - Axis along which to compute std
710
+ * @param ddof - Delta degrees of freedom (default: 0)
711
+ * @param keepdims - If true, reduced axes are left as dimensions with size 1
712
+ */
713
+ std(axis?: number, ddof?: number, keepdims?: boolean): NDArray | number;
714
+ /**
715
+ * Compute the variance, ignoring NaNs
716
+ * @param axis - Axis along which to compute variance
717
+ * @param ddof - Delta degrees of freedom (default: 0)
718
+ * @param keepdims - If true, reduced axes are left as dimensions with size 1
719
+ */
720
+ nanvar(axis?: number, ddof?: number, keepdims?: boolean): NDArray | number;
721
+ /**
722
+ * Compute the standard deviation, ignoring NaNs
723
+ * @param axis - Axis along which to compute std
724
+ * @param ddof - Delta degrees of freedom (default: 0)
725
+ * @param keepdims - If true, reduced axes are left as dimensions with size 1
726
+ */
727
+ nanstd(axis?: number, ddof?: number, keepdims?: boolean): NDArray | number;
728
+ /**
729
+ * Test whether all array elements along a given axis evaluate to True
730
+ */
731
+ all(axis?: number, keepdims?: boolean): NDArray | boolean;
732
+ /**
733
+ * Test whether any array elements along a given axis evaluate to True
734
+ */
735
+ any(axis?: number, keepdims?: boolean): NDArray | boolean;
736
+ /**
737
+ * Compute the median along the specified axis
738
+ */
739
+ median(axis?: number, keepdims?: boolean): NDArray | number;
740
+ /**
741
+ * Compute the median, ignoring NaNs
742
+ */
743
+ nanmedian(axis?: number, keepdims?: boolean): NDArray | number;
744
+ /**
745
+ * Compute the q-th percentile of the data along the specified axis
746
+ * @param q - Percentile to compute (0-100)
747
+ */
748
+ percentile(q: number, axis?: number, keepdims?: boolean): NDArray | number;
749
+ /**
750
+ * Compute the q-th quantile of the data along the specified axis
751
+ * @param q - Quantile to compute (0-1)
752
+ */
753
+ quantile(q: number, axis?: number, keepdims?: boolean): NDArray | number;
754
+ /**
755
+ * Compute the q-th quantile, ignoring NaNs
756
+ * @param q - Quantile to compute (0-1)
757
+ */
758
+ nanquantile(q: number, axis?: number, keepdims?: boolean): NDArray | number;
759
+ /**
760
+ * Compute the q-th percentile, ignoring NaNs
761
+ * @param q - Percentile to compute (0-100)
762
+ */
763
+ nanpercentile(q: number, axis?: number, keepdims?: boolean): NDArray | number;
764
+ /**
765
+ * Return the cumulative sum of elements along a given axis
766
+ */
767
+ cumsum(axis?: number): NDArray;
768
+ /**
769
+ * Return the cumulative product of elements along a given axis
770
+ */
771
+ cumprod(axis?: number): NDArray;
772
+ /**
773
+ * Return the cumulative sum of elements, treating NaNs as zero
774
+ */
775
+ nancumsum(axis?: number): NDArray;
776
+ /**
777
+ * Return the cumulative product of elements, treating NaNs as one
778
+ */
779
+ nancumprod(axis?: number): NDArray;
780
+ /**
781
+ * Return a sorted copy of the array
782
+ * @param axis - Axis along which to sort. Default is -1 (last axis)
783
+ */
784
+ sort(axis?: number): NDArray;
785
+ /**
786
+ * Returns the indices that would sort this array
787
+ * @param axis - Axis along which to sort. Default is -1 (last axis)
788
+ */
789
+ argsort(axis?: number): NDArray;
790
+ /**
791
+ * Partially sort the array
792
+ * @param kth - Element index to partition by
793
+ * @param axis - Axis along which to sort. Default is -1 (last axis)
794
+ */
795
+ partition(kth: number, axis?: number): NDArray;
796
+ /**
797
+ * Returns indices that would partition the array
798
+ * @param kth - Element index to partition by
799
+ * @param axis - Axis along which to sort. Default is -1 (last axis)
800
+ */
801
+ argpartition(kth: number, axis?: number): NDArray;
802
+ /**
803
+ * Return specified diagonals
804
+ * @param offset - Offset of the diagonal from the main diagonal
805
+ * @param axis1 - First axis of the 2-D sub-arrays
806
+ * @param axis2 - Second axis of the 2-D sub-arrays
807
+ */
808
+ diagonal(offset?: number, axis1?: number, axis2?: number): NDArray;
809
+ /**
810
+ * Return a new array with the specified shape
811
+ * If larger, filled with repeated copies of the original data
812
+ * @param newShape - Shape of the resized array
813
+ */
814
+ resize(newShape: number[]): NDArray;
815
+ /**
816
+ * Calculate the n-th discrete difference along the given axis
817
+ * @param n - Number of times values are differenced (default: 1)
818
+ * @param axis - Axis along which to compute difference (default: -1)
819
+ */
820
+ diff(n?: number, axis?: number): NDArray;
821
+ /**
822
+ * Take elements from array along an axis
823
+ * @param indices - Indices of elements to take
824
+ * @param axis - Axis along which to take
825
+ */
826
+ take(indices: number[], axis?: number): NDArray;
827
+ /**
828
+ * Repeat elements of an array
829
+ * @param repeats - Number of repetitions for each element
830
+ * @param axis - Axis along which to repeat
831
+ */
832
+ repeat(repeats: number | number[], axis?: number): NDArray;
833
+ /**
834
+ * Transpose array (permute dimensions)
835
+ * @param axes - Permutation of axes. If undefined, reverse the dimensions
836
+ * @returns Transposed array (always a view)
837
+ */
838
+ transpose(axes?: number[]): NDArray;
839
+ /**
840
+ * Remove axes of length 1
841
+ * @param axis - Axis to squeeze
842
+ * @returns Array with specified dimensions removed (always a view)
843
+ */
844
+ squeeze(axis?: number): NDArray;
845
+ /**
846
+ * Expand the shape by inserting a new axis of length 1
847
+ * @param axis - Position where new axis is placed
848
+ * @returns Array with additional dimension (always a view)
849
+ */
850
+ expand_dims(axis: number): NDArray;
851
+ /**
852
+ * Swap two axes of an array
853
+ * @param axis1 - First axis
854
+ * @param axis2 - Second axis
855
+ * @returns Array with swapped axes (always a view)
856
+ */
857
+ swapaxes(axis1: number, axis2: number): NDArray;
858
+ /**
859
+ * Move axes to new positions
860
+ * @param source - Original positions of axes to move
861
+ * @param destination - New positions for axes
862
+ * @returns Array with moved axes (always a view)
863
+ */
864
+ moveaxis(source: number | number[], destination: number | number[]): NDArray;
865
+ /**
866
+ * Return the indices of non-zero elements
867
+ * @returns Tuple of arrays, one for each dimension
868
+ */
869
+ nonzero(): NDArray[];
870
+ }
871
+ /**
872
+ * Return coordinate matrices from coordinate vectors
873
+ * @param arrays - 1D coordinate arrays
874
+ * @param indexing - 'xy' (Cartesian, default) or 'ij' (matrix indexing)
875
+ * @returns Array of coordinate grids
876
+ */
877
+ export declare function meshgrid(...args: (NDArray | {
878
+ indexing?: 'xy' | 'ij';
879
+ })[]): NDArray[];
880
+ //# sourceMappingURL=ndarray.d.ts.map