forked from SciSharp/NumSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNdArray.VStack.cs
More file actions
25 lines (23 loc) · 1004 Bytes
/
NdArray.VStack.cs
File metadata and controls
25 lines (23 loc) · 1004 Bytes
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
using System;
namespace NumSharp
{
public partial class NDArray
{
/// <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). Rebuilds arrays divided by vsplit.
/// </summary>
/// <typeparam name="T">The type dtype to return.</typeparam>
/// <param name="tup">The arrays must have the same shape along all but the first axis. 1-D arrays must have the same length.</param>
/// <returns>https://docs.scipy.org/doc/numpy/reference/generated/numpy.vstack.html</returns>
public NDArray vstack(params NDArray[] tup)
{
if (tup == null)
throw new ArgumentNullException(nameof(tup));
NDArray[] list = new NDArray[1 + tup.Length];
list[0] = this;
tup.CopyTo(list, 1);
return np.vstack(list);
}
}
}