forked from SciSharp/Numpy.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnp.array_manipulation.gen.cs
More file actions
1277 lines (1230 loc) · 53.6 KB
/
np.array_manipulation.gen.cs
File metadata and controls
1277 lines (1230 loc) · 53.6 KB
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
// Copyright (c) 2019 by the SciSharp Team
// Code generated by CodeMinion: https://github.com/SciSharp/CodeMinion
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using Python.Runtime;
using Numpy.Models;
using Python.Included;
namespace Numpy
{
public static partial class np
{
/// <summary>
/// Copies values from one array to another, broadcasting as necessary.<br></br>
///
/// Raises a TypeError if the casting rule is violated, and if
/// where is provided, it selects which elements to copy.
/// </summary>
/// <param name="dst">
/// The array into which values are copied.
/// </param>
/// <param name="src">
/// The array from which values are copied.
/// </param>
/// <param name="casting">
/// Controls what kind of data casting may occur when copying.
/// </param>
/// <param name="where">
/// A boolean array which is broadcasted to match the dimensions
/// of dst, and selects elements to copy from src to dst
/// wherever it contains the value True.
/// </param>
public static void copyto(NDarray dst, NDarray src, string casting = "same_kind", NDarray @where = null)
=> NumPy.Instance.copyto(dst, src, casting:casting, @where:@where);
/// <summary>
/// Copies values from one array to another, broadcasting as necessary.<br></br>
///
/// Raises a TypeError if the casting rule is violated, and if
/// where is provided, it selects which elements to copy.
/// </summary>
/// <param name="dst">
/// The array into which values are copied.
/// </param>
/// <param name="src">
/// The array from which values are copied.
/// </param>
/// <param name="casting">
/// Controls what kind of data casting may occur when copying.
/// </param>
/// <param name="where">
/// A boolean array which is broadcasted to match the dimensions
/// of dst, and selects elements to copy from src to dst
/// wherever it contains the value True.
/// </param>
public static void copyto(NDarray dst, NDarray src, string casting = "same_kind", bool[] @where = null)
=> NumPy.Instance.copyto(dst, src, casting:casting, @where:@where);
/// <summary>
/// Gives a new shape to an array without changing its data.<br></br>
///
/// Notes
///
/// It is not always possible to change the shape of an array without
/// copying the data.<br></br>
/// If you want an error to be raised when the data is copied,
/// you should assign the new shape to the shape attribute of the array:
///
/// The order keyword gives the index ordering both for fetching the values
/// from a, and then placing the values into the output array.<br></br>
///
/// For example, let’s say you have an array:
///
/// You can think of reshaping as first raveling the array (using the given
/// index order), then inserting the elements from the raveled array into the
/// new array using the same kind of index ordering as was used for the
/// raveling.
/// </summary>
/// <param name="a">
/// Array to be reshaped.
/// </param>
/// <param name="newshape">
/// The new shape should be compatible with the original shape.<br></br>
/// If
/// an integer, then the result will be a 1-D array of that length.<br></br>
///
/// One shape dimension can be -1. In this case, the value is
/// inferred from the length of the array and remaining dimensions.
/// </param>
/// <param name="order">
/// Read the elements of a using this index order, and place the
/// elements into the reshaped array using this index order.<br></br>
/// ‘C’
/// means to read / write the elements using C-like index order,
/// with the last axis index changing fastest, back to the first
/// axis index changing slowest.<br></br>
/// ‘F’ means to read / write the
/// elements using Fortran-like index order, with the first index
/// changing fastest, and the last index changing slowest.<br></br>
/// Note that
/// the ‘C’ and ‘F’ options take no account of the memory layout of
/// the underlying array, and only refer to the order of indexing.<br></br>
///
/// ‘A’ means to read / write the elements in Fortran-like index
/// order if a is Fortran contiguous in memory, C-like order
/// otherwise.
/// </param>
/// <returns>
/// This will be a new view object if possible; otherwise, it will
/// be a copy.<br></br>
/// Note there is no guarantee of the memory layout (C- or
/// Fortran- contiguous) of the returned array.
/// </returns>
public static NDarray reshape(NDarray a, Shape newshape, string order = null)
=> NumPy.Instance.reshape(a, newshape, order:order);
/// <summary>
/// Return a contiguous flattened array.<br></br>
///
/// A 1-D array, containing the elements of the input, is returned.<br></br>
/// A copy is
/// made only if needed.<br></br>
///
/// As of NumPy 1.10, the returned array will have the same type as the input
/// array.<br></br>
/// (for example, a masked array will be returned for a masked array
/// input)
///
/// Notes
///
/// In row-major, C-style order, in two dimensions, the row index
/// varies the slowest, and the column index the quickest.<br></br>
/// This can
/// be generalized to multiple dimensions, where row-major order
/// implies that the index along the first axis varies slowest, and
/// the index along the last quickest.<br></br>
/// The opposite holds for
/// column-major, Fortran-style index ordering.<br></br>
///
/// When a view is desired in as many cases as possible, arr.reshape(-1)
/// may be preferable.
/// </summary>
/// <param name="a">
/// Input array.<br></br>
/// The elements in a are read in the order specified by
/// order, and packed as a 1-D array.
/// </param>
/// <param name="order">
/// The elements of a are read using this index order.<br></br>
/// ‘C’ means
/// to index the elements in row-major, C-style order,
/// with the last axis index changing fastest, back to the first
/// axis index changing slowest.<br></br>
/// ‘F’ means to index the elements
/// in column-major, Fortran-style order, with the
/// first index changing fastest, and the last index changing
/// slowest.<br></br>
/// Note that the ‘C’ and ‘F’ options take no account of
/// the memory layout of the underlying array, and only refer to
/// the order of axis indexing.<br></br>
/// ‘A’ means to read the elements in
/// Fortran-like index order if a is Fortran contiguous in
/// memory, C-like order otherwise.<br></br>
/// ‘K’ means to read the
/// elements in the order they occur in memory, except for
/// reversing the data when strides are negative.<br></br>
/// By default, ‘C’
/// index order is used.
/// </param>
/// <returns>
/// y is an array of the same subtype as a, with shape (a.size,).<br></br>
///
/// Note that matrices are special cased for backward compatibility, if a
/// is a matrix, then y is a 1-D ndarray.
/// </returns>
public static NDarray ravel(NDarray a, string order = null)
=> NumPy.Instance.ravel(a, order:order);
/// <summary>
/// Return a copy of the array collapsed into one dimension.
/// </summary>
/// <param name="order">
/// ‘C’ means to flatten in row-major (C-style) order.<br></br>
///
/// ‘F’ means to flatten in column-major (Fortran-
/// style) order.<br></br>
/// ‘A’ means to flatten in column-major
/// order if a is Fortran contiguous in memory,
/// row-major order otherwise.<br></br>
/// ‘K’ means to flatten
/// a in the order the elements occur in memory.<br></br>
///
/// The default is ‘C’.
/// </param>
/// <returns>
/// A copy of the input array, flattened to one dimension.
/// </returns>
public static NDarray flatten(string order = null)
=> NumPy.Instance.flatten(order:order);
/// <summary>
/// Move axes of an array to new positions.<br></br>
///
/// Other axes remain in their original order.
/// </summary>
/// <param name="a">
/// The array whose axes should be reordered.
/// </param>
/// <param name="source">
/// Original positions of the axes to move.<br></br>
/// These must be unique.
/// </param>
/// <param name="destination">
/// Destination positions for each of the original axes.<br></br>
/// These must also be
/// unique.
/// </param>
/// <returns>
/// Array with moved axes.<br></br>
/// This array is a view of the input array.
/// </returns>
public static NDarray moveaxis(NDarray a, int[] source, int[] destination)
=> NumPy.Instance.moveaxis(a, source, destination);
/// <summary>
/// Roll the specified axis backwards, until it lies in a given position.<br></br>
///
/// This function continues to be supported for backward compatibility, but you
/// should prefer moveaxis.<br></br>
/// The moveaxis function was added in NumPy
/// 1.11.
/// </summary>
/// <param name="a">
/// Input array.
/// </param>
/// <param name="axis">
/// The axis to roll backwards.<br></br>
/// The positions of the other axes do not
/// change relative to one another.
/// </param>
/// <param name="start">
/// The axis is rolled until it lies before this position.<br></br>
/// The default,
/// 0, results in a “complete” roll.
/// </param>
/// <returns>
/// For NumPy >= 1.10.0 a view of a is always returned.<br></br>
/// For earlier
/// NumPy versions a view of a is returned only if the order of the
/// axes is changed, otherwise the input array is returned.
/// </returns>
public static NDarray rollaxis(NDarray a, int axis, int? start = 0)
=> NumPy.Instance.rollaxis(a, axis, start:start);
/// <summary>
/// Interchange two axes of an array.
/// </summary>
/// <param name="a">
/// Input array.
/// </param>
/// <param name="axis1">
/// First axis.
/// </param>
/// <param name="axis2">
/// Second axis.
/// </param>
/// <returns>
/// For NumPy >= 1.10.0, if a is an ndarray, then a view of a is
/// returned; otherwise a new array is created.<br></br>
/// For earlier NumPy
/// versions a view of a is returned only if the order of the
/// axes is changed, otherwise the input array is returned.
/// </returns>
public static NDarray swapaxes(NDarray a, int axis1, int axis2)
=> NumPy.Instance.swapaxes(a, axis1, axis2);
/// <summary>
/// Permute the dimensions of an array.<br></br>
///
/// Notes
///
/// Use transpose(a, argsort(axes)) to invert the transposition of tensors
/// when using the axes keyword argument.<br></br>
///
/// Transposing a 1-D array returns an unchanged view of the original array.
/// </summary>
/// <param name="a">
/// Input array.
/// </param>
/// <param name="axes">
/// By default, reverse the dimensions, otherwise permute the axes
/// according to the values given.
/// </param>
/// <returns>
/// a with its axes permuted.<br></br>
/// A view is returned whenever
/// possible.
/// </returns>
public static NDarray transpose(NDarray a, int[] axes = null)
=> NumPy.Instance.transpose(a, axes:axes);
/// <summary>
/// Convert inputs to arrays with at least one dimension.<br></br>
///
/// Scalar inputs are converted to 1-dimensional arrays, whilst
/// higher-dimensional inputs are preserved.
/// </summary>
/// <param name="arys">
/// One or more input arrays.
/// </param>
/// <returns>
/// An array, or list of arrays, each with a.ndim >= 1.<br></br>
///
/// Copies are made only if necessary.
/// </returns>
public static NDarray atleast_1d(params NDarray[] arys)
=> NumPy.Instance.atleast_1d(arys);
/// <summary>
/// View inputs as arrays with at least two dimensions.
/// </summary>
/// <param name="arys">
/// One or more array-like sequences.<br></br>
/// Non-array inputs are converted
/// to arrays.<br></br>
/// Arrays that already have two or more dimensions are
/// preserved.
/// </param>
/// <returns>
/// An array, or list of arrays, each with a.ndim >= 2.<br></br>
///
/// Copies are avoided where possible, and views with two or more
/// dimensions are returned.
/// </returns>
public static NDarray atleast_2d(params NDarray[] arys)
=> NumPy.Instance.atleast_2d(arys);
/// <summary>
/// View inputs as arrays with at least three dimensions.
/// </summary>
/// <param name="arys">
/// One or more array-like sequences.<br></br>
/// Non-array inputs are converted to
/// arrays.<br></br>
/// Arrays that already have three or more dimensions are
/// preserved.
/// </param>
/// <returns>
/// An array, or list of arrays, each with a.ndim >= 3.<br></br>
/// Copies are
/// avoided where possible, and views with three or more dimensions are
/// returned.<br></br>
/// For example, a 1-D array of shape (N,) becomes a view
/// of shape (1, N, 1), and a 2-D array of shape (M, N) becomes a
/// view of shape (M, N, 1).
/// </returns>
public static NDarray atleast_3d(params NDarray[] arys)
=> NumPy.Instance.atleast_3d(arys);
/// <summary>
/// Produce an object that mimics broadcasting.
/// </summary>
/// <param name="in2">
/// Input parameters.
/// </param>
/// <param name="in1">
/// Input parameters.
/// </param>
/// <returns>
/// Broadcast the input parameters against one another, and
/// return an object that encapsulates the result.<br></br>
///
/// Amongst others, it has shape and nd properties, and
/// may be used as an iterator.
/// </returns>
public static NDarray broadcast(NDarray in2, NDarray in1)
=> NumPy.Instance.broadcast(in2, in1);
/// <summary>
/// Broadcast an array to a new shape.<br></br>
///
/// Notes
/// </summary>
/// <param name="array">
/// The array to broadcast.
/// </param>
/// <param name="shape">
/// The shape of the desired array.
/// </param>
/// <param name="subok">
/// If True, then sub-classes will be passed-through, otherwise
/// the returned array will be forced to be a base-class array (default).
/// </param>
/// <returns>
/// A readonly view on the original array with the given shape.<br></br>
/// It is
/// typically not contiguous.<br></br>
/// Furthermore, more than one element of a
/// broadcasted array may refer to a single memory location.
/// </returns>
public static NDarray broadcast_to(NDarray array, Shape shape, bool? subok = false)
=> NumPy.Instance.broadcast_to(array, shape, subok:subok);
/// <summary>
/// Broadcast any number of arrays against each other.
/// </summary>
/// <param name="args">
/// The arrays to broadcast.
/// </param>
/// <param name="subok">
/// If True, then sub-classes will be passed-through, otherwise
/// the returned arrays will be forced to be a base-class array (default).
/// </param>
/// <returns>
/// These arrays are views on the original arrays.<br></br>
/// They are typically
/// not contiguous.<br></br>
/// Furthermore, more than one element of a
/// broadcasted array may refer to a single memory location.<br></br>
/// If you
/// need to write to the arrays, make copies first.
/// </returns>
public static NDarray[] broadcast_arrays(NDarray[] args, bool? subok = null)
=> NumPy.Instance.broadcast_arrays(args, subok:subok);
/// <summary>
/// Expand the shape of an array.<br></br>
///
/// Insert a new axis that will appear at the axis position in the expanded
/// array shape.
/// </summary>
/// <param name="a">
/// Input array.
/// </param>
/// <param name="axis">
/// Position in the expanded axes where the new axis is placed.
/// </param>
/// <returns>
/// Output array.<br></br>
/// The number of dimensions is one greater than that of
/// the input array.
/// </returns>
public static NDarray expand_dims(NDarray a, int axis)
=> NumPy.Instance.expand_dims(a, axis);
/// <summary>
/// Remove single-dimensional entries from the shape of an array.
/// </summary>
/// <param name="a">
/// Input data.
/// </param>
/// <param name="axis">
/// Selects a subset of the single-dimensional entries in the
/// shape.<br></br>
/// If an axis is selected with shape entry greater than
/// one, an error is raised.
/// </param>
/// <returns>
/// The input array, but with all or a subset of the
/// dimensions of length 1 removed.<br></br>
/// This is always a itself
/// or a view into a.
/// </returns>
public static NDarray squeeze(NDarray a, int[] axis = null)
=> NumPy.Instance.squeeze(a, axis:axis);
/// <summary>
/// Return an array converted to a float type.
/// </summary>
/// <param name="a">
/// The input array.
/// </param>
/// <param name="dtype">
/// Float type code to coerce input array a.<br></br>
/// If dtype is one of the
/// ‘int’ dtypes, it is replaced with float64.
/// </param>
/// <returns>
/// The input a as a float ndarray.
/// </returns>
public static NDarray asfarray(NDarray a, Dtype dtype = null)
=> NumPy.Instance.asfarray(a, dtype:dtype);
/// <summary>
/// Return an array (ndim >= 1) laid out in Fortran order in memory.
/// </summary>
/// <param name="a">
/// Input array.
/// </param>
/// <param name="dtype">
/// By default, the data-type is inferred from the input data.
/// </param>
/// <returns>
/// The input a in Fortran, or column-major, order.
/// </returns>
public static NDarray asfortranarray(NDarray a, Dtype dtype = null)
=> NumPy.Instance.asfortranarray(a, dtype:dtype);
/// <summary>
/// Convert the input to an array, checking for NaNs or Infs.
/// </summary>
/// <param name="a">
/// Input data, in any form that can be converted to an array.<br></br>
/// This
/// includes lists, lists of tuples, tuples, tuples of tuples, tuples
/// of lists and ndarrays.<br></br>
/// Success requires no NaNs or Infs.
/// </param>
/// <param name="dtype">
/// By default, the data-type is inferred from the input data.
/// </param>
/// <param name="order">
/// Whether to use row-major (C-style) or
/// column-major (Fortran-style) memory representation.<br></br>
///
/// Defaults to ‘C’.
/// </param>
/// <returns>
/// Array interpretation of a.<br></br>
/// No copy is performed if the input
/// is already an ndarray.<br></br>
/// If a is a subclass of ndarray, a base
/// class ndarray is returned.
/// </returns>
public static NDarray asarray_chkfinite(NDarray a, Dtype dtype = null, string order = null)
=> NumPy.Instance.asarray_chkfinite(a, dtype:dtype, order:order);
/// <summary>
/// Return an ndarray of the provided type that satisfies requirements.<br></br>
///
/// This function is useful to be sure that an array with the correct flags
/// is returned for passing to compiled code (perhaps through ctypes).<br></br>
///
/// Notes
///
/// The returned array will be guaranteed to have the listed requirements
/// by making a copy if needed.
/// </summary>
/// <param name="a">
/// The object to be converted to a type-and-requirement-satisfying array.
/// </param>
/// <param name="dtype">
/// The required data-type.<br></br>
/// If None preserve the current dtype.<br></br>
/// If your
/// application requires the data to be in native byteorder, include
/// a byteorder specification as a part of the dtype specification.
/// </param>
/// <param name="requirements">
/// The requirements list can be any of the following
/// </param>
public static NDarray require(NDarray a, Dtype dtype, string[] requirements = null)
=> NumPy.Instance.require(a, dtype, requirements:requirements);
/// <summary>
/// Join a sequence of arrays along an existing axis.<br></br>
///
/// Notes
///
/// When one or more of the arrays to be concatenated is a MaskedArray,
/// this function will return a MaskedArray object instead of an ndarray,
/// but the input masks are not preserved.<br></br>
/// In cases where a MaskedArray
/// is expected as input, use the ma.concatenate function from the masked
/// array module instead.
/// </summary>
/// <param name="arys">
/// The arrays must have the same shape, except in the dimension
/// corresponding to axis (the first, by default).
/// </param>
/// <param name="axis">
/// The axis along which the arrays will be joined.<br></br>
/// If axis is None,
/// arrays are flattened before use.<br></br>
/// Default is 0.
/// </param>
/// <param name="out">
/// If provided, the destination to place the result.<br></br>
/// The shape must be
/// correct, matching that of what concatenate would have returned if no
/// out argument were specified.
/// </param>
/// <returns>
/// The concatenated array.
/// </returns>
public static NDarray concatenate(NDarray[] arys, int? axis = 0, NDarray @out = null)
=> NumPy.Instance.concatenate(arys, axis:axis, @out:@out);
/// <summary>
/// Join a sequence of arrays along a new axis.<br></br>
///
/// The axis parameter specifies the index of the new axis in the dimensions
/// of the result.<br></br>
/// For example, if axis=0 it will be the first dimension
/// and if axis=-1 it will be the last dimension.
/// </summary>
/// <param name="arrays">
/// Each array must have the same shape.
/// </param>
/// <param name="axis">
/// The axis in the result array along which the input arrays are stacked.
/// </param>
/// <param name="out">
/// If provided, the destination to place the result.<br></br>
/// The shape must be
/// correct, matching that of what stack would have returned if no
/// out argument were specified.
/// </param>
/// <returns>
/// The stacked array has one more dimension than the input arrays.
/// </returns>
public static NDarray stack(NDarray[] arrays, int? axis = 0, NDarray @out = null)
=> NumPy.Instance.stack(arrays, axis:axis, @out:@out);
/// <summary>
/// Stack 1-D arrays as columns into a 2-D array.<br></br>
///
/// Take a sequence of 1-D arrays and stack them as columns
/// to make a single 2-D array.<br></br>
/// 2-D arrays are stacked as-is,
/// just like with hstack.<br></br>
/// 1-D arrays are turned into 2-D columns
/// first.
/// </summary>
/// <param name="tup">
/// Arrays to stack.<br></br>
/// All of them must have the same first dimension.
/// </param>
/// <returns>
/// The array formed by stacking the given arrays.
/// </returns>
public static NDarray column_stack(params NDarray[] tup)
=> NumPy.Instance.column_stack(tup);
/// <summary>
/// Stack arrays in sequence depth wise (along third axis).<br></br>
///
/// This is equivalent to concatenation along the third axis after 2-D arrays
/// of shape (M,N) have been reshaped to (M,N,1) and 1-D arrays of shape
/// (N,) have been reshaped to (1,N,1).<br></br>
/// Rebuilds arrays divided by
/// dsplit.<br></br>
///
/// This function makes most sense for arrays with up to 3 dimensions.<br></br>
/// For
/// instance, for pixel-data with a height (first axis), width (second axis),
/// and r/g/b channels (third axis).<br></br>
/// The functions concatenate, stack and
/// block provide more general stacking and concatenation operations.
/// </summary>
/// <param name="tup">
/// The arrays must have the same shape along all but the third axis.<br></br>
///
/// 1-D or 2-D arrays must have the same shape.
/// </param>
/// <returns>
/// The array formed by stacking the given arrays, will be at least 3-D.
/// </returns>
public static NDarray dstack(params NDarray[] tup)
=> NumPy.Instance.dstack(tup);
/// <summary>
/// Stack arrays in sequence horizontally (column wise).<br></br>
///
/// This is equivalent to concatenation along the second axis, except for 1-D
/// arrays where it concatenates along the first axis.<br></br>
/// Rebuilds arrays divided
/// by hsplit.<br></br>
///
/// This function makes most sense for arrays with up to 3 dimensions.<br></br>
/// For
/// instance, for pixel-data with a height (first axis), width (second axis),
/// and r/g/b channels (third axis).<br></br>
/// The functions concatenate, stack and
/// block provide more general stacking and concatenation operations.
/// </summary>
/// <param name="tup">
/// The arrays must have the same shape along all but the second axis,
/// except 1-D arrays which can be any length.
/// </param>
/// <returns>
/// The array formed by stacking the given arrays.
/// </returns>
public static NDarray hstack(params NDarray[] tup)
=> NumPy.Instance.hstack(tup);
/// <summary>
/// Stack arrays in sequence vertically (row wise).<br></br>
///
/// This is equivalent to concatenation along the first axis after 1-D arrays
/// of shape (N,) have been reshaped to (1,N).<br></br>
/// Rebuilds arrays divided by
/// vsplit.<br></br>
///
/// This function makes most sense for arrays with up to 3 dimensions.<br></br>
/// For
/// instance, for pixel-data with a height (first axis), width (second axis),
/// and r/g/b channels (third axis).<br></br>
/// The functions concatenate, stack and
/// block provide more general stacking and concatenation operations.
/// </summary>
/// <param name="tup">
/// The arrays must have the same shape along all but the first axis.<br></br>
///
/// 1-D arrays must have the same length.
/// </param>
/// <returns>
/// The array formed by stacking the given arrays, will be at least 2-D.
/// </returns>
public static NDarray vstack(params NDarray[] tup)
=> NumPy.Instance.vstack(tup);
/*
/// <summary>
/// Assemble an nd-array from nested lists of blocks.<br></br>
///
/// Blocks in the innermost lists are concatenated (see concatenate) along
/// the last dimension (-1), then these are concatenated along the
/// second-last dimension (-2), and so on until the outermost list is reached.<br></br>
///
/// Blocks can be of any dimension, but will not be broadcasted using the normal
/// rules.<br></br>
/// Instead, leading axes of size 1 are inserted, to make block.ndim
/// the same for all blocks.<br></br>
/// This is primarily useful for working with scalars,
/// and means that code like np.block([v, 1]) is valid, where
/// v.ndim == 1.<br></br>
///
/// When the nested list is two levels deep, this allows block matrices to be
/// constructed from their components.<br></br>
///
/// Notes
///
/// When called with only scalars, np.block is equivalent to an ndarray
/// call.<br></br>
/// So np.block([[1, 2], [3, 4]]) is equivalent to
/// np.array([[1, 2], [3, 4]]).<br></br>
///
/// This function does not enforce that the blocks lie on a fixed grid.<br></br>
///
/// np.block([[a, b], [c, d]]) is not restricted to arrays of the form:
///
/// But is also allowed to produce, for some a, b, c, d:
///
/// Since concatenation happens along the last axis first, block is _not_
/// capable of producing the following directly:
///
/// Matlab’s “square bracket stacking”, [A, B, ...; p, q, ...], is
/// equivalent to np.block([[A, B, ...], [p, q, ...]]).
/// </summary>
/// <param name="arrays">
/// If passed a single ndarray or scalar (a nested list of depth 0), this
/// is returned unmodified (and not copied).<br></br>
///
/// Elements shapes must match along the appropriate axes (without
/// broadcasting), but leading 1s will be prepended to the shape as
/// necessary to make the dimensions match.
/// </param>
/// <returns>
/// The array assembled from the given blocks.<br></br>
///
/// The dimensionality of the output is equal to the greatest of:
/// * the dimensionality of all the inputs
/// * the depth to which the input list is nested
/// </returns>
public static NDarray block(nested list of array_like or scalars (but not tuples) arrays)
=> NumPy.Instance.block(arrays);
*/
/// <summary>
/// Split an array into multiple sub-arrays.
/// </summary>
/// <param name="ary">
/// Array to be divided into sub-arrays.
/// </param>
/// <param name="indices_or_sections">
/// If indices_or_sections is an integer, N, the array will be divided
/// into N equal arrays along axis.<br></br>
/// If such a split is not possible,
/// an error is raised.<br></br>
///
/// If indices_or_sections is a 1-D array of sorted integers, the entries
/// indicate where along axis the array is split.<br></br>
/// For example,
/// [2, 3] would, for axis=0, result in
///
/// If an index exceeds the dimension of the array along axis,
/// an empty sub-array is returned correspondingly.
/// </param>
/// <param name="axis">
/// The axis along which to split, default is 0.
/// </param>
/// <returns>
/// A list of sub-arrays.
/// </returns>
public static NDarray[] split(NDarray ary, int[] indices_or_sections, int? axis = 0)
=> NumPy.Instance.split(ary, indices_or_sections, axis:axis);
/// <summary>
/// Construct an array by repeating A the number of times given by reps.<br></br>
///
/// If reps has length d, the result will have dimension of
/// max(d, A.ndim).<br></br>
///
/// If A.ndim < d, A is promoted to be d-dimensional by prepending new
/// axes.<br></br>
/// So a shape (3,) array is promoted to (1, 3) for 2-D replication,
/// or shape (1, 1, 3) for 3-D replication.<br></br>
/// If this is not the desired
/// behavior, promote A to d-dimensions manually before calling this
/// function.<br></br>
///
/// If A.ndim > d, reps is promoted to A.ndim by pre-pending 1’s to it.<br></br>
///
/// Thus for an A of shape (2, 3, 4, 5), a reps of (2, 2) is treated as
/// (1, 1, 2, 2).<br></br>
///
/// Note : Although tile may be used for broadcasting, it is strongly
/// recommended to use numpy’s broadcasting operations and functions.
/// </summary>
/// <param name="A">
/// The input array.
/// </param>
/// <param name="reps">
/// The number of repetitions of A along each axis.
/// </param>
/// <returns>
/// The tiled output array.
/// </returns>
public static NDarray tile(NDarray A, NDarray reps)
=> NumPy.Instance.tile(A, reps);
/// <summary>
/// Repeat elements of an array.
/// </summary>
/// <param name="a">
/// Input array.
/// </param>
/// <param name="repeats">
/// The number of repetitions for each element.<br></br>
/// repeats is broadcasted
/// to fit the shape of the given axis.
/// </param>
/// <param name="axis">
/// The axis along which to repeat values.<br></br>
/// By default, use the
/// flattened input array, and return a flat output array.
/// </param>
/// <returns>
/// Output array which has the same shape as a, except along
/// the given axis.
/// </returns>
public static NDarray repeat(NDarray a, int[] repeats, int? axis = null)
=> NumPy.Instance.repeat(a, repeats, axis:axis);
/// <summary>
/// Return a new array with sub-arrays along an axis deleted.<br></br>
/// For a one
/// dimensional array, this returns those entries not returned by
/// arr[obj].<br></br>
///
/// Notes
///
/// Often it is preferable to use a boolean mask.<br></br>
/// For example:
///
/// Is equivalent to np.delete(arr, [0,2,4], axis=0), but allows further
/// use of mask.
/// </summary>
/// <param name="arr">
/// Input array.
/// </param>
/// <param name="obj">
/// Indicate which sub-arrays to remove.
/// </param>
/// <param name="axis">
/// The axis along which to delete the subarray defined by obj.<br></br>
///
/// If axis is None, obj is applied to the flattened array.
/// </param>
/// <returns>
/// A copy of arr with the elements specified by obj removed.<br></br>
/// Note
/// that delete does not occur in-place.<br></br>
/// If axis is None, out is
/// a flattened array.
/// </returns>
public static NDarray delete(NDarray arr, Slice obj, int? axis = null)
=> NumPy.Instance.delete(arr, obj, axis:axis);
/// <summary>
/// Insert values along the given axis before the given indices.<br></br>
///
/// Notes
///
/// Note that for higher dimensional inserts obj=0 behaves very different
/// from obj=[0] just like arr[:,0,:] = values is different from
/// arr[:,[0],:] = values.
/// </summary>
/// <param name="arr">
/// Input array.
/// </param>
/// <param name="obj">
/// Object that defines the index or indices before which values is
/// inserted.<br></br>
///
/// Support for multiple insertions when obj is a single scalar or a
/// sequence with one element (similar to calling insert multiple
/// times).
/// </param>
/// <param name="values">
/// Values to insert into arr.<br></br>
/// If the type of values is different
/// from that of arr, values is converted to the type of arr.<br></br>
///
/// values should be shaped so that arr[...,obj,...] = values
/// is legal.
/// </param>
/// <param name="axis">
/// Axis along which to insert values.<br></br>
/// If axis is None then arr
/// is flattened first.
/// </param>
/// <returns>
/// A copy of arr with values inserted.<br></br>
/// Note that insert
/// does not occur in-place: a new array is returned.<br></br>
/// If
/// axis is None, out is a flattened array.
/// </returns>
public static NDarray insert(NDarray arr, int obj = 0, NDarray values = null, int? axis = null)
=> NumPy.Instance.insert(arr, obj:obj, values:values, axis:axis);
/// <summary>
/// Append values to the end of an array.
/// </summary>
/// <param name="arr">
/// Values are appended to a copy of this array.
/// </param>
/// <param name="values">
/// These values are appended to a copy of arr.<br></br>
/// It must be of the
/// correct shape (the same shape as arr, excluding axis).<br></br>
/// If
/// axis is not specified, values can be any shape and will be
/// flattened before use.
/// </param>
/// <param name="axis">
/// The axis along which values are appended.<br></br>
/// If axis is not
/// given, both arr and values are flattened before use.
/// </param>
/// <returns>
/// A copy of arr with values appended to axis.<br></br>
/// Note that
/// append does not occur in-place: a new array is allocated and
/// filled.<br></br>
/// If axis is None, out is a flattened array.
/// </returns>
public static NDarray append(NDarray arr, NDarray values, int? axis = null)
=> NumPy.Instance.append(arr, values, axis:axis);
/// <summary>
/// Return a new array with the specified shape.<br></br>
///
/// If the new array is larger than the original array, then the new
/// array is filled with repeated copies of a.<br></br>
/// Note that this behavior
/// is different from a.resize(new_shape) which fills with zeros instead
/// of repeated copies of a.<br></br>
///
/// Notes
///
/// Warning: This functionality does not consider axes separately,
/// i.e.<br></br>
/// it does not apply interpolation/extrapolation.<br></br>
///
/// It fills the return array with the required number of elements, taken
/// from a as they are laid out in memory, disregarding strides and axes.<br></br>
///
/// (This is in case the new shape is smaller.<br></br>
/// For larger, see above.)
/// This functionality is therefore not suitable to resize images,
/// or data where each axis represents a separate and distinct entity.
/// </summary>
/// <param name="a">
/// Array to be resized.
/// </param>
/// <param name="new_shape">
/// Shape of resized array.
/// </param>
/// <returns>
/// The new array is formed from the data in the old array, repeated