Table of Contents

Class np.CClass

Namespace
NumSharp
Assembly
NumSharp.dll

Translates slice expressions to concatenation along the SECOND axis.

public sealed class np.CClass : np.AxisConcatenator
Inheritance
np.CClass
Inherited Members

Examples

np.c_[np.array(new[] {1, 2, 3}), np.array(new[] {4, 5, 6})];  // [[1 4] [2 5] [3 6]]
np.c_[np.array(new[,] {{1, 2, 3}}), 0, 0, np.array(new[,] {{4, 5, 6}})];  // [[1 2 3 0 0 4 5 6]]

Remarks

Port of NumPy 2.x numpy.c_. Short-hand for np.r_["-1,2,0", …]: entries are upgraded to at least 2-D with the 1s POST-pended (so a 1-D entry becomes a COLUMN vector, (N,)(N, 1)) and then stacked along their last axis. Entries that are already 2-D or higher pass through untouched.

Every leading-directive, slice-expression and weak-scalar rule of np.RClass applies here too — np.c_["0:3", "3:6"] is [[0 3] [1 4] [2 5]]. See np.AxisConcatenator for how a Python slice literal is spelled in C#.

https://numpy.org/doc/stable/reference/generated/numpy.c_.html