-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
/
__init__.pyi
3743 lines (3487 loc) · 127 KB
/
__init__.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import builtins
import os
import sys
import mmap
import array as _array
import datetime as dt
from abc import abstractmethod
from types import TracebackType, MappingProxyType
from contextlib import ContextDecorator
from numpy.core._internal import _ctypes
from numpy.typing import (
# Arrays
ArrayLike,
NDArray,
_SupportsArray,
_NestedSequence,
_RecursiveSequence,
_SupportsArray,
_ArrayLikeBool_co,
_ArrayLikeUInt_co,
_ArrayLikeInt_co,
_ArrayLikeFloat_co,
_ArrayLikeComplex_co,
_ArrayLikeNumber_co,
_ArrayLikeTD64_co,
_ArrayLikeDT64_co,
_ArrayLikeObject_co,
# DTypes
DTypeLike,
_SupportsDType,
_VoidDTypeLike,
# Shapes
_Shape,
_ShapeLike,
# Scalars
_CharLike_co,
_BoolLike_co,
_IntLike_co,
_FloatLike_co,
_ComplexLike_co,
_TD64Like_co,
_NumberLike_co,
_ScalarLike_co,
# `number` precision
NBitBase,
_256Bit,
_128Bit,
_96Bit,
_80Bit,
_64Bit,
_32Bit,
_16Bit,
_8Bit,
_NBitByte,
_NBitShort,
_NBitIntC,
_NBitIntP,
_NBitInt,
_NBitLongLong,
_NBitHalf,
_NBitSingle,
_NBitDouble,
_NBitLongDouble,
# Character codes
_BoolCodes,
_UInt8Codes,
_UInt16Codes,
_UInt32Codes,
_UInt64Codes,
_Int8Codes,
_Int16Codes,
_Int32Codes,
_Int64Codes,
_Float16Codes,
_Float32Codes,
_Float64Codes,
_Complex64Codes,
_Complex128Codes,
_ByteCodes,
_ShortCodes,
_IntCCodes,
_IntPCodes,
_IntCodes,
_LongLongCodes,
_UByteCodes,
_UShortCodes,
_UIntCCodes,
_UIntPCodes,
_UIntCodes,
_ULongLongCodes,
_HalfCodes,
_SingleCodes,
_DoubleCodes,
_LongDoubleCodes,
_CSingleCodes,
_CDoubleCodes,
_CLongDoubleCodes,
_DT64Codes,
_TD64Codes,
_StrCodes,
_BytesCodes,
_VoidCodes,
_ObjectCodes,
# Ufuncs
_UFunc_Nin1_Nout1,
_UFunc_Nin2_Nout1,
_UFunc_Nin1_Nout2,
_UFunc_Nin2_Nout2,
_GUFunc_Nin2_Nout1,
)
from numpy.typing._callable import (
_BoolOp,
_BoolBitOp,
_BoolSub,
_BoolTrueDiv,
_BoolMod,
_BoolDivMod,
_TD64Div,
_IntTrueDiv,
_UnsignedIntOp,
_UnsignedIntBitOp,
_UnsignedIntMod,
_UnsignedIntDivMod,
_SignedIntOp,
_SignedIntBitOp,
_SignedIntMod,
_SignedIntDivMod,
_FloatOp,
_FloatMod,
_FloatDivMod,
_ComplexOp,
_NumberOp,
_ComparisonOp,
)
# NOTE: Numpy's mypy plugin is used for removing the types unavailable
# to the specific platform
from numpy.typing._extended_precision import (
uint128 as uint128,
uint256 as uint256,
int128 as int128,
int256 as int256,
float80 as float80,
float96 as float96,
float128 as float128,
float256 as float256,
complex160 as complex160,
complex192 as complex192,
complex256 as complex256,
complex512 as complex512,
)
from typing import (
Any,
ByteString,
Callable,
Container,
Callable,
Dict,
Generic,
IO,
Iterable,
List,
Mapping,
NoReturn,
Optional,
overload,
Sequence,
Sized,
SupportsComplex,
SupportsFloat,
SupportsInt,
Text,
Tuple,
Type,
TypeVar,
Union,
)
if sys.version_info >= (3, 8):
from typing import Literal as L, Protocol, SupportsIndex, Final
else:
from typing_extensions import Literal as L, Protocol, SupportsIndex, Final
# Ensures that the stubs are picked up
from numpy import (
char as char,
ctypeslib as ctypeslib,
fft as fft,
lib as lib,
linalg as linalg,
ma as ma,
matrixlib as matrixlib,
polynomial as polynomial,
random as random,
rec as rec,
testing as testing,
version as version,
)
from numpy.core.function_base import (
linspace as linspace,
logspace as logspace,
geomspace as geomspace,
)
from numpy.core.fromnumeric import (
take as take,
reshape as reshape,
choose as choose,
repeat as repeat,
put as put,
swapaxes as swapaxes,
transpose as transpose,
partition as partition,
argpartition as argpartition,
sort as sort,
argsort as argsort,
argmax as argmax,
argmin as argmin,
searchsorted as searchsorted,
resize as resize,
squeeze as squeeze,
diagonal as diagonal,
trace as trace,
ravel as ravel,
nonzero as nonzero,
shape as shape,
compress as compress,
clip as clip,
sum as sum,
all as all,
any as any,
cumsum as cumsum,
ptp as ptp,
amax as amax,
amin as amin,
prod as prod,
cumprod as cumprod,
ndim as ndim,
size as size,
around as around,
mean as mean,
std as std,
var as var,
)
from numpy.core._asarray import (
require as require,
)
from numpy.core._type_aliases import (
sctypes as sctypes,
sctypeDict as sctypeDict,
)
from numpy.core._ufunc_config import (
seterr as seterr,
geterr as geterr,
setbufsize as setbufsize,
getbufsize as getbufsize,
seterrcall as seterrcall,
geterrcall as geterrcall,
_SupportsWrite,
_ErrKind,
_ErrFunc,
_ErrDictOptional,
)
from numpy.core.arrayprint import (
set_printoptions as set_printoptions,
get_printoptions as get_printoptions,
array2string as array2string,
format_float_scientific as format_float_scientific,
format_float_positional as format_float_positional,
array_repr as array_repr,
array_str as array_str,
set_string_function as set_string_function,
printoptions as printoptions,
)
from numpy.core.einsumfunc import (
einsum as einsum,
einsum_path as einsum_path,
)
from numpy.core.multiarray import (
ALLOW_THREADS as ALLOW_THREADS,
BUFSIZE as BUFSIZE,
CLIP as CLIP,
MAXDIMS as MAXDIMS,
MAY_SHARE_BOUNDS as MAY_SHARE_BOUNDS,
MAY_SHARE_EXACT as MAY_SHARE_EXACT,
RAISE as RAISE,
WRAP as WRAP,
tracemalloc_domain as tracemalloc_domain,
array as array,
empty_like as empty_like,
empty as empty,
zeros as zeros,
concatenate as concatenate,
inner as inner,
where as where,
lexsort as lexsort,
can_cast as can_cast,
min_scalar_type as min_scalar_type,
result_type as result_type,
dot as dot,
vdot as vdot,
bincount as bincount,
copyto as copyto,
putmask as putmask,
packbits as packbits,
unpackbits as unpackbits,
shares_memory as shares_memory,
may_share_memory as may_share_memory,
asarray as asarray,
asanyarray as asanyarray,
ascontiguousarray as ascontiguousarray,
asfortranarray as asfortranarray,
arange as arange,
busday_count as busday_count,
busday_offset as busday_offset,
compare_chararrays as compare_chararrays,
datetime_as_string as datetime_as_string,
datetime_data as datetime_data,
frombuffer as frombuffer,
fromfile as fromfile,
fromiter as fromiter,
is_busday as is_busday,
promote_types as promote_types,
seterrobj as seterrobj,
geterrobj as geterrobj,
fromstring as fromstring,
frompyfunc as frompyfunc,
)
from numpy.core.numeric import (
zeros_like as zeros_like,
ones as ones,
ones_like as ones_like,
full as full,
full_like as full_like,
count_nonzero as count_nonzero,
isfortran as isfortran,
argwhere as argwhere,
flatnonzero as flatnonzero,
correlate as correlate,
convolve as convolve,
outer as outer,
tensordot as tensordot,
roll as roll,
rollaxis as rollaxis,
moveaxis as moveaxis,
cross as cross,
indices as indices,
fromfunction as fromfunction,
isscalar as isscalar,
binary_repr as binary_repr,
base_repr as base_repr,
identity as identity,
allclose as allclose,
isclose as isclose,
array_equal as array_equal,
array_equiv as array_equiv,
)
from numpy.core.numerictypes import (
maximum_sctype as maximum_sctype,
issctype as issctype,
obj2sctype as obj2sctype,
issubclass_ as issubclass_,
issubsctype as issubsctype,
issubdtype as issubdtype,
sctype2char as sctype2char,
find_common_type as find_common_type,
nbytes as nbytes,
cast as cast,
ScalarType as ScalarType,
typecodes as typecodes,
)
from numpy.core.shape_base import (
atleast_1d as atleast_1d,
atleast_2d as atleast_2d,
atleast_3d as atleast_3d,
block as block,
hstack as hstack,
stack as stack,
vstack as vstack,
)
from numpy.lib import (
emath as emath,
)
from numpy.lib.arraypad import (
pad as pad,
)
from numpy.lib.arraysetops import (
ediff1d as ediff1d,
intersect1d as intersect1d,
setxor1d as setxor1d,
union1d as union1d,
setdiff1d as setdiff1d,
unique as unique,
in1d as in1d,
isin as isin,
)
from numpy.lib.arrayterator import (
Arrayterator as Arrayterator,
)
from numpy.lib.function_base import (
select as select,
piecewise as piecewise,
trim_zeros as trim_zeros,
copy as copy,
iterable as iterable,
percentile as percentile,
diff as diff,
gradient as gradient,
angle as angle,
unwrap as unwrap,
sort_complex as sort_complex,
disp as disp,
flip as flip,
rot90 as rot90,
extract as extract,
place as place,
asarray_chkfinite as asarray_chkfinite,
average as average,
bincount as bincount,
digitize as digitize,
cov as cov,
corrcoef as corrcoef,
msort as msort,
median as median,
sinc as sinc,
hamming as hamming,
hanning as hanning,
bartlett as bartlett,
blackman as blackman,
kaiser as kaiser,
trapz as trapz,
i0 as i0,
add_newdoc as add_newdoc,
add_docstring as add_docstring,
meshgrid as meshgrid,
delete as delete,
insert as insert,
append as append,
interp as interp,
add_newdoc_ufunc as add_newdoc_ufunc,
quantile as quantile,
)
from numpy.lib.index_tricks import (
ravel_multi_index as ravel_multi_index,
unravel_index as unravel_index,
mgrid as mgrid,
ogrid as ogrid,
r_ as r_,
c_ as c_,
s_ as s_,
index_exp as index_exp,
ix_ as ix_,
fill_diagonal as fill_diagonal,
diag_indices as diag_indices,
diag_indices_from as diag_indices_from,
)
from numpy.lib.nanfunctions import (
nansum as nansum,
nanmax as nanmax,
nanmin as nanmin,
nanargmax as nanargmax,
nanargmin as nanargmin,
nanmean as nanmean,
nanmedian as nanmedian,
nanpercentile as nanpercentile,
nanvar as nanvar,
nanstd as nanstd,
nanprod as nanprod,
nancumsum as nancumsum,
nancumprod as nancumprod,
nanquantile as nanquantile,
)
from numpy.lib.npyio import (
savetxt as savetxt,
loadtxt as loadtxt,
genfromtxt as genfromtxt,
recfromtxt as recfromtxt,
recfromcsv as recfromcsv,
load as load,
loads as loads,
save as save,
savez as savez,
savez_compressed as savez_compressed,
packbits as packbits,
unpackbits as unpackbits,
fromregex as fromregex,
)
from numpy.lib.polynomial import (
poly as poly,
roots as roots,
polyint as polyint,
polyder as polyder,
polyadd as polyadd,
polysub as polysub,
polymul as polymul,
polydiv as polydiv,
polyval as polyval,
polyfit as polyfit,
)
from numpy.lib.shape_base import (
column_stack as column_stack,
row_stack as row_stack,
dstack as dstack,
array_split as array_split,
split as split,
hsplit as hsplit,
vsplit as vsplit,
dsplit as dsplit,
apply_over_axes as apply_over_axes,
expand_dims as expand_dims,
apply_along_axis as apply_along_axis,
kron as kron,
tile as tile,
get_array_wrap as get_array_wrap,
take_along_axis as take_along_axis,
put_along_axis as put_along_axis,
)
from numpy.lib.stride_tricks import (
broadcast_to as broadcast_to,
broadcast_arrays as broadcast_arrays,
broadcast_shapes as broadcast_shapes,
)
from numpy.lib.twodim_base import (
diag as diag,
diagflat as diagflat,
eye as eye,
fliplr as fliplr,
flipud as flipud,
tri as tri,
triu as triu,
tril as tril,
vander as vander,
histogram2d as histogram2d,
mask_indices as mask_indices,
tril_indices as tril_indices,
tril_indices_from as tril_indices_from,
triu_indices as triu_indices,
triu_indices_from as triu_indices_from,
)
from numpy.lib.type_check import (
mintypecode as mintypecode,
asfarray as asfarray,
real as real,
imag as imag,
iscomplex as iscomplex,
isreal as isreal,
iscomplexobj as iscomplexobj,
isrealobj as isrealobj,
nan_to_num as nan_to_num,
real_if_close as real_if_close,
typename as typename,
common_type as common_type,
)
from numpy.lib.ufunclike import (
fix as fix,
isposinf as isposinf,
isneginf as isneginf,
)
from numpy.lib.utils import (
issubclass_ as issubclass_,
issubsctype as issubsctype,
issubdtype as issubdtype,
deprecate as deprecate,
deprecate_with_doc as deprecate_with_doc,
get_include as get_include,
info as info,
source as source,
who as who,
lookfor as lookfor,
byte_bounds as byte_bounds,
safe_eval as safe_eval,
)
__all__: List[str]
__path__: List[str]
__version__: str
__git_version__: str
# TODO: Move placeholders to their respective module once
# their annotations are properly implemented
#
# Placeholders for classes
# TODO: Remove `__getattr__` once the classes are stubbed out
class MachAr:
def __init__(
self,
float_conv: Any = ...,
int_conv: Any = ...,
float_to_float: Any = ...,
float_to_str: Any = ...,
title: Any = ...,
) -> None: ...
def __getattr__(self, key: str) -> Any: ...
class chararray(ndarray[_ShapeType, _DType_co]):
def __new__(
subtype,
shape: Any,
itemsize: Any = ...,
unicode: Any = ...,
buffer: Any = ...,
offset: Any = ...,
strides: Any = ...,
order: Any = ...,
) -> Any: ...
def __array_finalize__(self, obj): ...
def argsort(self, axis=..., kind=..., order=...): ...
def capitalize(self): ...
def center(self, width, fillchar=...): ...
def count(self, sub, start=..., end=...): ...
def decode(self, encoding=..., errors=...): ...
def encode(self, encoding=..., errors=...): ...
def endswith(self, suffix, start=..., end=...): ...
def expandtabs(self, tabsize=...): ...
def find(self, sub, start=..., end=...): ...
def index(self, sub, start=..., end=...): ...
def isalnum(self): ...
def isalpha(self): ...
def isdigit(self): ...
def islower(self): ...
def isspace(self): ...
def istitle(self): ...
def isupper(self): ...
def join(self, seq): ...
def ljust(self, width, fillchar=...): ...
def lower(self): ...
def lstrip(self, chars=...): ...
def partition(self, sep): ...
def replace(self, old, new, count=...): ...
def rfind(self, sub, start=..., end=...): ...
def rindex(self, sub, start=..., end=...): ...
def rjust(self, width, fillchar=...): ...
def rpartition(self, sep): ...
def rsplit(self, sep=..., maxsplit=...): ...
def rstrip(self, chars=...): ...
def split(self, sep=..., maxsplit=...): ...
def splitlines(self, keepends=...): ...
def startswith(self, prefix, start=..., end=...): ...
def strip(self, chars=...): ...
def swapcase(self): ...
def title(self): ...
def translate(self, table, deletechars=...): ...
def upper(self): ...
def zfill(self, width): ...
def isnumeric(self): ...
def isdecimal(self): ...
class finfo:
def __new__(cls, dtype: Any) -> Any: ...
def __getattr__(self, key: str) -> Any: ...
class format_parser:
def __init__(
self,
formats: Any,
names: Any,
titles: Any,
aligned: Any = ...,
byteorder: Any = ...,
) -> None: ...
class iinfo:
def __init__(self, int_type: Any) -> None: ...
def __getattr__(self, key: str) -> Any: ...
class matrix(ndarray[_ShapeType, _DType_co]):
def __new__(
subtype,
data: Any,
dtype: Any = ...,
copy: Any = ...,
) -> Any: ...
def __array_finalize__(self, obj): ...
def __getitem__(self, index): ...
def __mul__(self, other): ...
def __rmul__(self, other): ...
def __imul__(self, other): ...
def __pow__(self, other): ...
def __ipow__(self, other): ...
def __rpow__(self, other): ...
def tolist(self): ...
def sum(self, axis=..., dtype=..., out=...): ...
def squeeze(self, axis=...): ...
def flatten(self, order=...): ...
def mean(self, axis=..., dtype=..., out=...): ...
def std(self, axis=..., dtype=..., out=..., ddof=...): ...
def var(self, axis=..., dtype=..., out=..., ddof=...): ...
def prod(self, axis=..., dtype=..., out=...): ...
def any(self, axis=..., out=...): ...
def all(self, axis=..., out=...): ...
def max(self, axis=..., out=...): ...
def argmax(self, axis=..., out=...): ...
def min(self, axis=..., out=...): ...
def argmin(self, axis=..., out=...): ...
def ptp(self, axis=..., out=...): ...
def ravel(self, order=...): ...
@property
def T(self): ...
@property
def I(self): ...
@property
def A(self): ...
@property
def A1(self): ...
@property
def H(self): ...
def getT(self): ...
def getA(self): ...
def getA1(self): ...
def getH(self): ...
def getI(self): ...
class memmap(ndarray[_ShapeType, _DType_co]):
def __new__(
subtype,
filename: Any,
dtype: Any = ...,
mode: Any = ...,
offset: Any = ...,
shape: Any = ...,
order: Any = ...,
) -> Any: ...
def __getattr__(self, key: str) -> Any: ...
class nditer:
def __new__(
cls,
op: Any,
flags: Any = ...,
op_flags: Any = ...,
op_dtypes: Any = ...,
order: Any = ...,
casting: Any = ...,
op_axes: Any = ...,
itershape: Any = ...,
buffersize: Any = ...,
) -> Any: ...
def __getattr__(self, key: str) -> Any: ...
class poly1d:
def __init__(
self,
c_or_r: Any,
r: Any = ...,
variable: Any = ...,
) -> None: ...
def __call__(self, val: Any) -> Any: ...
__hash__: Any
@property
def coeffs(self): ...
@coeffs.setter
def coeffs(self, value): ...
@property
def c(self): ...
@c.setter
def c(self, value): ...
@property
def coef(self): ...
@coef.setter
def coef(self, value): ...
@property
def coefficients(self): ...
@coefficients.setter
def coefficients(self, value): ...
@property
def variable(self): ...
@property
def order(self): ...
@property
def o(self): ...
@property
def roots(self): ...
@property
def r(self): ...
def __array__(self, t=...): ...
def __len__(self): ...
def __neg__(self): ...
def __pos__(self): ...
def __mul__(self, other): ...
def __rmul__(self, other): ...
def __add__(self, other): ...
def __radd__(self, other): ...
def __pow__(self, val): ...
def __sub__(self, other): ...
def __rsub__(self, other): ...
def __div__(self, other): ...
def __truediv__(self, other): ...
def __rdiv__(self, other): ...
def __rtruediv__(self, other): ...
def __eq__(self, other): ...
def __ne__(self, other): ...
def __getitem__(self, val): ...
def __setitem__(self, key, val): ...
def __iter__(self): ...
def integ(self, m=..., k=...): ...
def deriv(self, m=...): ...
class recarray(ndarray[_ShapeType, _DType_co]):
def __new__(
subtype,
shape: Any,
dtype: Any = ...,
buf: Any = ...,
offset: Any = ...,
strides: Any = ...,
formats: Any = ...,
names: Any = ...,
titles: Any = ...,
byteorder: Any = ...,
aligned: Any = ...,
order: Any = ...,
) -> Any: ...
def __array_finalize__(self, obj): ...
def __getattribute__(self, attr): ...
def __setattr__(self, attr, val): ...
def __getitem__(self, indx): ...
def field(self, attr, val=...): ...
class record(void):
def __getattribute__(self, attr): ...
def __setattr__(self, attr, val): ...
def __getitem__(self, indx): ...
def pprint(self): ...
class vectorize:
pyfunc: Any
cache: Any
signature: Any
otypes: Any
excluded: Any
__doc__: Any
def __init__(
self,
pyfunc,
otypes: Any = ...,
doc: Any = ...,
excluded: Any = ...,
cache: Any = ...,
signature: Any = ...,
) -> None: ...
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
# Placeholders for Python-based functions
def asmatrix(data, dtype=...): ...
def asscalar(a): ...
def cumproduct(*args, **kwargs): ...
def histogram(a, bins=..., range=..., normed=..., weights=..., density=...): ...
def histogram_bin_edges(a, bins=..., range=..., weights=...): ...
def histogramdd(sample, bins=..., range=..., normed=..., weights=..., density=...): ...
def mat(data, dtype=...): ...
def max(a, axis=..., out=..., keepdims=..., initial=..., where=...): ...
def min(a, axis=..., out=..., keepdims=..., initial=..., where=...): ...
def product(*args, **kwargs): ...
def round(a, decimals=..., out=...): ...
def round_(a, decimals=..., out=...): ...
def show_config(): ...
# TODO: Sort out which parameters are positional-only
def nested_iters(*args, **kwargs): ... # TODO: Sort out parameters
_NdArraySubClass = TypeVar("_NdArraySubClass", bound=ndarray)
_DTypeScalar_co = TypeVar("_DTypeScalar_co", covariant=True, bound=generic)
_ByteOrder = L["S", "<", ">", "=", "|", "L", "B", "N", "I"]
class dtype(Generic[_DTypeScalar_co]):
names: None | Tuple[str, ...]
# Overload for subclass of generic
@overload
def __new__(
cls,
dtype: Type[_DTypeScalar_co],
align: bool = ...,
copy: bool = ...,
) -> dtype[_DTypeScalar_co]: ...
# Overloads for string aliases, Python types, and some assorted
# other special cases. Order is sometimes important because of the
# subtype relationships
#
# bool < int < float < complex
#
# so we have to make sure the overloads for the narrowest type is
# first.
# Builtin types
@overload
def __new__(cls, dtype: Type[bool], align: bool = ..., copy: bool = ...) -> dtype[bool_]: ...
@overload
def __new__(cls, dtype: Type[int], align: bool = ..., copy: bool = ...) -> dtype[int_]: ...
@overload
def __new__(cls, dtype: None | Type[float], align: bool = ..., copy: bool = ...) -> dtype[float_]: ...
@overload
def __new__(cls, dtype: Type[complex], align: bool = ..., copy: bool = ...) -> dtype[complex_]: ...
@overload
def __new__(cls, dtype: Type[str], align: bool = ..., copy: bool = ...) -> dtype[str_]: ...
@overload
def __new__(cls, dtype: Type[bytes], align: bool = ..., copy: bool = ...) -> dtype[bytes_]: ...
# `unsignedinteger` string-based representations
@overload
def __new__(cls, dtype: _UInt8Codes, align: bool = ..., copy: bool = ...) -> dtype[uint8]: ...
@overload
def __new__(cls, dtype: _UInt16Codes, align: bool = ..., copy: bool = ...) -> dtype[uint16]: ...
@overload
def __new__(cls, dtype: _UInt32Codes, align: bool = ..., copy: bool = ...) -> dtype[uint32]: ...
@overload
def __new__(cls, dtype: _UInt64Codes, align: bool = ..., copy: bool = ...) -> dtype[uint64]: ...
@overload
def __new__(cls, dtype: _UByteCodes, align: bool = ..., copy: bool = ...) -> dtype[ubyte]: ...
@overload
def __new__(cls, dtype: _UShortCodes, align: bool = ..., copy: bool = ...) -> dtype[ushort]: ...
@overload
def __new__(cls, dtype: _UIntCCodes, align: bool = ..., copy: bool = ...) -> dtype[uintc]: ...
@overload
def __new__(cls, dtype: _UIntPCodes, align: bool = ..., copy: bool = ...) -> dtype[uintp]: ...
@overload
def __new__(cls, dtype: _UIntCodes, align: bool = ..., copy: bool = ...) -> dtype[uint]: ...
@overload
def __new__(cls, dtype: _ULongLongCodes, align: bool = ..., copy: bool = ...) -> dtype[ulonglong]: ...
# `signedinteger` string-based representations
@overload
def __new__(cls, dtype: _Int8Codes, align: bool = ..., copy: bool = ...) -> dtype[int8]: ...
@overload
def __new__(cls, dtype: _Int16Codes, align: bool = ..., copy: bool = ...) -> dtype[int16]: ...
@overload
def __new__(cls, dtype: _Int32Codes, align: bool = ..., copy: bool = ...) -> dtype[int32]: ...
@overload
def __new__(cls, dtype: _Int64Codes, align: bool = ..., copy: bool = ...) -> dtype[int64]: ...
@overload
def __new__(cls, dtype: _ByteCodes, align: bool = ..., copy: bool = ...) -> dtype[byte]: ...
@overload
def __new__(cls, dtype: _ShortCodes, align: bool = ..., copy: bool = ...) -> dtype[short]: ...
@overload
def __new__(cls, dtype: _IntCCodes, align: bool = ..., copy: bool = ...) -> dtype[intc]: ...
@overload
def __new__(cls, dtype: _IntPCodes, align: bool = ..., copy: bool = ...) -> dtype[intp]: ...
@overload
def __new__(cls, dtype: _IntCodes, align: bool = ..., copy: bool = ...) -> dtype[int_]: ...
@overload
def __new__(cls, dtype: _LongLongCodes, align: bool = ..., copy: bool = ...) -> dtype[longlong]: ...
# `floating` string-based representations
@overload
def __new__(cls, dtype: _Float16Codes, align: bool = ..., copy: bool = ...) -> dtype[float16]: ...
@overload
def __new__(cls, dtype: _Float32Codes, align: bool = ..., copy: bool = ...) -> dtype[float32]: ...
@overload
def __new__(cls, dtype: _Float64Codes, align: bool = ..., copy: bool = ...) -> dtype[float64]: ...
@overload
def __new__(cls, dtype: _HalfCodes, align: bool = ..., copy: bool = ...) -> dtype[half]: ...
@overload
def __new__(cls, dtype: _SingleCodes, align: bool = ..., copy: bool = ...) -> dtype[single]: ...
@overload
def __new__(cls, dtype: _DoubleCodes, align: bool = ..., copy: bool = ...) -> dtype[double]: ...
@overload
def __new__(cls, dtype: _LongDoubleCodes, align: bool = ..., copy: bool = ...) -> dtype[longdouble]: ...
# `complexfloating` string-based representations
@overload
def __new__(cls, dtype: _Complex64Codes, align: bool = ..., copy: bool = ...) -> dtype[complex64]: ...
@overload
def __new__(cls, dtype: _Complex128Codes, align: bool = ..., copy: bool = ...) -> dtype[complex128]: ...
@overload
def __new__(cls, dtype: _CSingleCodes, align: bool = ..., copy: bool = ...) -> dtype[csingle]: ...
@overload
def __new__(cls, dtype: _CDoubleCodes, align: bool = ..., copy: bool = ...) -> dtype[cdouble]: ...
@overload