forked from SciSharp/Numpy.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnp.array.cs
More file actions
43 lines (36 loc) · 1.31 KB
/
np.array.cs
File metadata and controls
43 lines (36 loc) · 1.31 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
using System;
using System.Collections.Generic;
using System.Text;
namespace Numpy
{
public static partial class np
{
/// <summary>
/// Create an array.
///
/// <param name="data">
/// The array to initialize the ndarray with
/// </param>
/// <returns>
/// An array object satisfying the specified requirements.
/// </returns>
public static NDarray<T> array<T>(params T[] data)
{
return NumPy.Instance.array(data);
}
public static NDarray<T> array<T>(T[,,] data, Dtype dtype = null, bool? copy = null, string order = null, bool? subok = null, int? ndmin = null)
{
return NumPy.Instance.array(data, dtype, copy, order, subok, ndmin);
}
public static NDarray asarray(ValueType a, Dtype dtype = null)
=> NumPy.Instance.asarray(a, dtype: dtype);
/// <summary>
/// Convert an array of size 1 to its scalar equivalent.
/// </summary>
/// <returns>
/// Scalar representation of a. The output data type is the same type
/// returned by the input’s item method.
/// </returns>
public static T asscalar<T>(NDarray a) => NumPy.Instance.asscalar<T>(a);
}
}