forked from SciSharp/Numpy.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNDarray.gen.cs
More file actions
11443 lines (11162 loc) · 491 KB
/
NDarray.gen.cs
File metadata and controls
11443 lines (11162 loc) · 491 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;
namespace Numpy
{
public partial class NDarray
{
/// <summary>
/// Copy an element of an array to a standard Python scalar and return it.<br></br>
///
/// Notes
///
/// When the data type of a is longdouble or clongdouble, item() returns
/// a scalar array object because there is no available Python scalar that
/// would not lose information.<br></br>
/// Void arrays return a buffer object for item(),
/// unless fields are defined, in which case a tuple is returned.<br></br>
///
/// item is very similar to a[args], except, instead of an array scalar,
/// a standard Python scalar is returned.<br></br>
/// This can be useful for speeding up
/// access to elements of the array and doing arithmetic on elements of the
/// array using Python’s optimized math.
/// </summary>
/// <returns>
/// A copy of the specified element of the array as a suitable
/// Python scalar
/// </returns>
public T item<T>(params int[] args)
{
//auto-generated code, do not change
var __self__=self;
var pyargs=ToTuple(new object[]
{
args,
});
var kwargs=new PyDict();
dynamic py = __self__.InvokeMethod("item", pyargs, kwargs);
return ToCsharp<T>(py);
}
/*
/// <summary>
/// Return the array as a (possibly nested) list.<br></br>
///
/// Return a copy of the array data as a (nested) Python list.<br></br>
///
/// Data items are converted to the nearest compatible Python type.<br></br>
///
/// Notes
///
/// The array may be recreated, a = np.array(a.tolist()).
/// </summary>
/// <returns>
/// The possibly nested list of array elements.
/// </returns>
public List<T> tolist<T>()
{
//auto-generated code, do not change
var __self__=self;
dynamic py = __self__.InvokeMethod("tolist");
return ToCsharp<List<T>>(py);
}
*/
/// <summary>
/// Write array to a file as text or binary (default).<br></br>
///
/// Data is always written in ‘C’ order, independent of the order of a.<br></br>
///
/// The data produced by this method can be recovered using the function
/// fromfile().<br></br>
///
/// Notes
///
/// This is a convenience function for quick storage of array data.<br></br>
///
/// Information on endianness and precision is lost, so this method is not a
/// good choice for files intended to archive data or transport data between
/// machines with different endianness.<br></br>
/// Some of these problems can be overcome
/// by outputting the data as text files, at the expense of speed and file
/// size.<br></br>
///
/// When fid is a file object, array contents are directly written to the
/// file, bypassing the file object’s write method.<br></br>
/// As a result, tofile
/// cannot be used with files objects supporting compression (e.g., GzipFile)
/// or file-like objects that do not support fileno() (e.g., BytesIO).
/// </summary>
/// <param name="fid">
/// An open file object, or a string containing a filename.
/// </param>
/// <param name="sep">
/// Separator between array items for text output.<br></br>
///
/// If “” (empty), a binary file is written, equivalent to
/// file.write(a.tobytes()).
/// </param>
/// <param name="format">
/// Format string for text file output.<br></br>
///
/// Each entry in the array is formatted to text by first converting
/// it to the closest Python type, and then using “format” % item.
/// </param>
public void tofile(string fid, string sep, string format)
{
//auto-generated code, do not change
var __self__=self;
var pyargs=ToTuple(new object[]
{
fid,
sep,
format,
});
var kwargs=new PyDict();
dynamic py = __self__.InvokeMethod("tofile", pyargs, kwargs);
}
/// <summary>
/// Dump a pickle of the array to the specified file.<br></br>
///
/// The array can be read back with pickle.load or numpy.load.
/// </summary>
/// <param name="file">
/// A string naming the dump file.
/// </param>
public void dump(string file)
{
//auto-generated code, do not change
var __self__=self;
var pyargs=ToTuple(new object[]
{
file,
});
var kwargs=new PyDict();
dynamic py = __self__.InvokeMethod("dump", pyargs, kwargs);
}
/// <summary>
/// Returns the pickle of the array as a string.<br></br>
///
/// pickle.loads or numpy.loads will convert the string back to an array.
/// </summary>
public void dumps()
{
//auto-generated code, do not change
var __self__=self;
dynamic py = __self__.InvokeMethod("dumps");
}
/// <summary>
/// Copy of the array, cast to a specified type.<br></br>
///
/// Notes
///
/// Starting in NumPy 1.9, astype method now returns an error if the string
/// dtype to cast to is not long enough in ‘safe’ casting mode to hold the max
/// value of integer/float array that is being casted.<br></br>
/// Previously the casting
/// was allowed even if the result was truncated.
/// </summary>
/// <param name="dtype">
/// Typecode or data-type to which the array is cast.
/// </param>
/// <param name="order">
/// Controls the memory layout order of the result.<br></br>
///
/// ‘C’ means C order, ‘F’ means Fortran order, ‘A’
/// means ‘F’ order if all the arrays are Fortran contiguous,
/// ‘C’ order otherwise, and ‘K’ means as close to the
/// order the array elements appear in memory as possible.<br></br>
///
/// Default is ‘K’.
/// </param>
/// <param name="casting">
/// Controls what kind of data casting may occur.<br></br>
/// Defaults to ‘unsafe’
/// for backwards compatibility.
/// </param>
/// <param name="subok">
/// If True, then sub-classes will be passed-through (default), otherwise
/// the returned array will be forced to be a base-class array.
/// </param>
/// <param name="copy">
/// By default, astype always returns a newly allocated array.<br></br>
/// If this
/// is set to false, and the dtype, order, and subok
/// requirements are satisfied, the input array is returned instead
/// of a copy.
/// </param>
/// <returns>
/// Unless copy is False and the other conditions for returning the input
/// array are satisfied (see description for copy input parameter), arr_t
/// is a new array of the same shape as the input array, with dtype, order
/// given by dtype, order.
/// </returns>
public NDarray astype(Dtype dtype, string order = null, string casting = null, bool? subok = null, bool? copy = null)
{
//auto-generated code, do not change
var __self__=self;
var pyargs=ToTuple(new object[]
{
dtype,
});
var kwargs=new PyDict();
if (order!=null) kwargs["order"]=ToPython(order);
if (casting!=null) kwargs["casting"]=ToPython(casting);
if (subok!=null) kwargs["subok"]=ToPython(subok);
if (copy!=null) kwargs["copy"]=ToPython(copy);
dynamic py = __self__.InvokeMethod("astype", pyargs, kwargs);
return ToCsharp<NDarray>(py);
}
/// <summary>
/// Swap the bytes of the array elements
///
/// Toggle between low-endian and big-endian data representation by
/// returning a byteswapped array, optionally swapped in-place.
/// </summary>
/// <param name="inplace">
/// If True, swap bytes in-place, default is False.
/// </param>
/// <returns>
/// The byteswapped array.<br></br>
/// If inplace is True, this is
/// a view to self.
/// </returns>
public NDarray byteswap(bool? inplace = null)
{
//auto-generated code, do not change
var __self__=self;
var pyargs=ToTuple(new object[]
{
});
var kwargs=new PyDict();
if (inplace!=null) kwargs["inplace"]=ToPython(inplace);
dynamic py = __self__.InvokeMethod("byteswap", pyargs, kwargs);
return ToCsharp<NDarray>(py);
}
/// <summary>
/// Return a copy of the array.
/// </summary>
/// <param name="order">
/// Controls the memory layout of the copy.<br></br>
/// ‘C’ means C-order,
/// ‘F’ means F-order, ‘A’ means ‘F’ if a is Fortran contiguous,
/// ‘C’ otherwise.<br></br>
/// ‘K’ means match the layout of a as closely
/// as possible.<br></br>
/// (Note that this function and numpy.copy are very
/// similar, but have different default values for their order=
/// arguments.)
/// </param>
public void copy(string order = null)
{
//auto-generated code, do not change
var __self__=self;
var pyargs=ToTuple(new object[]
{
});
var kwargs=new PyDict();
if (order!=null) kwargs["order"]=ToPython(order);
dynamic py = __self__.InvokeMethod("copy", pyargs, kwargs);
}
/// <summary>
/// Returns a field of the given array as a certain type.<br></br>
///
/// A field is a view of the array data with a given data-type.<br></br>
/// The values in
/// the view are determined by the given type and the offset into the current
/// array in bytes.<br></br>
/// The offset needs to be such that the view dtype fits in the
/// array dtype; for example an array of dtype complex128 has 16-byte elements.<br></br>
///
/// If taking a view with a 32-bit integer (4 bytes), the offset needs to be
/// between 0 and 12 bytes.
/// </summary>
/// <param name="dtype">
/// The data type of the view.<br></br>
/// The dtype size of the view can not be larger
/// than that of the array itself.
/// </param>
/// <param name="offset">
/// Number of bytes to skip before beginning the element view.
/// </param>
public void getfield(Dtype dtype, int offset)
{
//auto-generated code, do not change
var __self__=self;
var pyargs=ToTuple(new object[]
{
dtype,
offset,
});
var kwargs=new PyDict();
dynamic py = __self__.InvokeMethod("getfield", pyargs, kwargs);
}
/// <summary>
/// Set array flags WRITEABLE, ALIGNED, (WRITEBACKIFCOPY and UPDATEIFCOPY),
/// respectively.<br></br>
///
/// These Boolean-valued flags affect how numpy interprets the memory
/// area used by a (see Notes below).<br></br>
/// The ALIGNED flag can only
/// be set to True if the data is actually aligned according to the type.<br></br>
///
/// The WRITEBACKIFCOPY and (deprecated) UPDATEIFCOPY flags can never be set
/// to True.<br></br>
/// The flag WRITEABLE can only be set to True if the array owns its
/// own memory, or the ultimate owner of the memory exposes a writeable buffer
/// interface, or is a string.<br></br>
/// (The exception for string is made so that
/// unpickling can be done without copying memory.)
///
/// Notes
///
/// Array flags provide information about how the memory area used
/// for the array is to be interpreted.<br></br>
/// There are 7 Boolean flags
/// in use, only four of which can be changed by the user:
/// WRITEBACKIFCOPY, UPDATEIFCOPY, WRITEABLE, and ALIGNED.<br></br>
///
/// WRITEABLE (W) the data area can be written to;
///
/// ALIGNED (A) the data and strides are aligned appropriately for the hardware
/// (as determined by the compiler);
///
/// UPDATEIFCOPY (U) (deprecated), replaced by WRITEBACKIFCOPY;
///
/// WRITEBACKIFCOPY (X) this array is a copy of some other array (referenced
/// by .base).<br></br>
/// When the C-API function PyArray_ResolveWritebackIfCopy is
/// called, the base array will be updated with the contents of this array.<br></br>
///
/// All flags can be accessed using the single (upper case) letter as well
/// as the full name.
/// </summary>
/// <param name="write">
/// Describes whether or not a can be written to.
/// </param>
/// <param name="align">
/// Describes whether or not a is aligned properly for its type.
/// </param>
/// <param name="uic">
/// Describes whether or not a is a copy of another “base” array.
/// </param>
public void setflags(bool? write = null, bool? align = null, bool? uic = null)
{
//auto-generated code, do not change
var __self__=self;
var pyargs=ToTuple(new object[]
{
});
var kwargs=new PyDict();
if (write!=null) kwargs["write"]=ToPython(write);
if (align!=null) kwargs["align"]=ToPython(align);
if (uic!=null) kwargs["uic"]=ToPython(uic);
dynamic py = __self__.InvokeMethod("setflags", pyargs, kwargs);
}
/// <summary>
/// Fill the array with a scalar value.
/// </summary>
/// <param name="value">
/// All elements of a will be assigned this value.
/// </param>
public void fill(ValueType @value)
{
//auto-generated code, do not change
var __self__=self;
var pyargs=ToTuple(new object[]
{
@value,
});
var kwargs=new PyDict();
dynamic py = __self__.InvokeMethod("fill", pyargs, kwargs);
}
/// <summary>
/// Returns a view of the array with axes transposed.<br></br>
///
/// For a 1-D array, this has no effect.<br></br>
/// (To change between column and
/// row vectors, first cast the 1-D array into a matrix object.)
/// For a 2-D array, this is the usual matrix transpose.<br></br>
///
/// For an n-D array, if axes are given, their order indicates how the
/// axes are permuted (see Examples).<br></br>
/// If axes are not provided and
/// a.shape = (i[0], i[1], ... i[n-2], i[n-1]), then
/// a.transpose().shape = (i[n-1], i[n-2], ... i[1], i[0]).
/// </summary>
/// <returns>
/// View of a, with axes suitably permuted.
/// </returns>
public NDarray transpose(params int[] axes)
{
//auto-generated code, do not change
var __self__=self;
var pyargs=ToTuple(new object[]
{
});
var kwargs=new PyDict();
if (axes!=null) kwargs["axes"]=ToPython(axes);
dynamic py = __self__.InvokeMethod("transpose", pyargs, kwargs);
return ToCsharp<NDarray>(py);
}
/// <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 NDarray flatten(string order = null)
{
//auto-generated code, do not change
var __self__=self;
var pyargs=ToTuple(new object[]
{
});
var kwargs=new PyDict();
if (order!=null) kwargs["order"]=ToPython(order);
dynamic py = __self__.InvokeMethod("flatten", pyargs, kwargs);
return ToCsharp<NDarray>(py);
}
/// <summary>
/// For unpickling.<br></br>
///
/// The state argument must be a sequence that contains the following
/// elements:
/// </summary>
/// <param name="version">
/// optional pickle version.<br></br>
/// If omitted defaults to 0.
/// </param>
/// <param name="rawdata">
/// a binary string with the data (or a list if ‘a’ is an object array)
/// </param>
public void __setstate__(int version, Shape shape, Dtype dtype, bool isFortran, string rawdata)
{
//auto-generated code, do not change
var __self__=self;
var pyargs=ToTuple(new object[]
{
version,
shape,
dtype,
isFortran,
rawdata,
});
var kwargs=new PyDict();
dynamic py = __self__.InvokeMethod("__setstate__", pyargs, kwargs);
}
/// <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="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 NDarray reshape(Shape newshape, string order = null)
{
//auto-generated code, do not change
var @this=this;
return NumPy.Instance.reshape(@this, 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="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 NDarray ravel(string order = null)
{
//auto-generated code, do not change
var @this=this;
return NumPy.Instance.ravel(@this, order:order);
}
/// <summary>
/// Move axes of an array to new positions.<br></br>
///
/// Other axes remain in their original order.
/// </summary>
/// <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 NDarray moveaxis(int[] source, int[] destination)
{
//auto-generated code, do not change
var @this=this;
return NumPy.Instance.moveaxis(@this, 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="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 NDarray rollaxis(int axis, int? start = 0)
{
//auto-generated code, do not change
var @this=this;
return NumPy.Instance.rollaxis(@this, axis, start:start);
}
/// <summary>
/// Interchange two axes of an array.
/// </summary>
/// <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 NDarray swapaxes(int axis1, int axis2)
{
//auto-generated code, do not change
var @this=this;
return NumPy.Instance.swapaxes(@this, axis1, axis2);
}
/// <summary>
/// Produce an object that mimics broadcasting.
/// </summary>
/// <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 NDarray broadcast(NDarray in1)
{
//auto-generated code, do not change
var @this=this;
return NumPy.Instance.broadcast(@this, in1);
}
/// <summary>
/// Broadcast an array to a new shape.<br></br>
///
/// Notes
/// </summary>
/// <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 NDarray broadcast_to(Shape shape, bool? subok = false)
{
//auto-generated code, do not change
var @this=this;
return NumPy.Instance.broadcast_to(@this, shape, 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="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 NDarray expand_dims(int axis)
{
//auto-generated code, do not change
var @this=this;
return NumPy.Instance.expand_dims(@this, axis);
}
/// <summary>
/// Remove single-dimensional entries from the shape of an array.
/// </summary>
/// <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 NDarray squeeze(params int[] axis)
{
//auto-generated code, do not change
var @this=this;
return NumPy.Instance.squeeze(@this, axis:axis);
}
/// <summary>
/// Return an array converted to a float type.
/// </summary>
/// <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 NDarray asfarray(Dtype dtype = null)
{
//auto-generated code, do not change
var @this=this;
return NumPy.Instance.asfarray(@this, dtype:dtype);
}
/// <summary>
/// Return an array (ndim >= 1) laid out in Fortran order in memory.
/// </summary>
/// <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 NDarray asfortranarray(Dtype dtype = null)
{
//auto-generated code, do not change
var @this=this;
return NumPy.Instance.asfortranarray(@this, dtype:dtype);
}
/// <summary>
/// Convert the input to an array, checking for NaNs or Infs.
/// </summary>
/// <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 NDarray asarray_chkfinite(Dtype dtype = null, string order = null)
{
//auto-generated code, do not change
var @this=this;
return NumPy.Instance.asarray_chkfinite(@this, 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="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 NDarray require(Dtype dtype, string[] requirements = null)
{
//auto-generated code, do not change
var @this=this;
return NumPy.Instance.require(@this, dtype, requirements:requirements);
}
/// <summary>
/// Split an array into multiple sub-arrays.
/// </summary>
/// <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 NDarray[] split(int[] indices_or_sections, int? axis = 0)
{
//auto-generated code, do not change
var @this=this;
return NumPy.Instance.split(@this, 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="reps">
/// The number of repetitions of A along each axis.
/// </param>
/// <returns>
/// The tiled output array.
/// </returns>
public NDarray tile(NDarray reps)
{
//auto-generated code, do not change
var @this=this;
return NumPy.Instance.tile(@this, reps);
}
/// <summary>
/// Repeat elements of an array.
/// </summary>
/// <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 NDarray repeat(int[] repeats, int? axis = null)
{
//auto-generated code, do not change
var @this=this;
return NumPy.Instance.repeat(@this, 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="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 NDarray delete(Slice obj, int? axis = null)
{
//auto-generated code, do not change
var @this=this;
return NumPy.Instance.delete(@this, 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="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