Skip to content

[Routines] Add column_stack, concatenate, hstack, vstack, and row_stack#352

Merged
shivasankarka merged 1 commit into
Mojo-Numerics-and-Algorithms-group:pre-0.10from
sauterp:push-mmnplspuxpuq
May 6, 2026
Merged

[Routines] Add column_stack, concatenate, hstack, vstack, and row_stack#352
shivasankarka merged 1 commit into
Mojo-Numerics-and-Algorithms-group:pre-0.10from
sauterp:push-mmnplspuxpuq

Conversation

@sauterp
Copy link
Copy Markdown
Contributor

@sauterp sauterp commented Apr 30, 2026

Implement numpy-compatible array joining routines in numojo/routines/manipulation.mojo:

  • concatenate(): Join arrays along an existing axis
  • column_stack(): Stack 1-D arrays as columns into 2-D, or hstack 2-D+ arrays
  • row_stack(): Stack arrays vertically (1-D reshaped to (1, N))
  • hstack(): Horizontal stacking (axis=0 for 1-D, axis=1 for 2-D+)
  • vstack(): Vertical stacking (alias for row_stack)

Tests validate against numpy equivalents for 1-D, 2-D, 3-D, and mixed-dimension inputs.

@sauterp sauterp marked this pull request as ready for review April 30, 2026 21:50
@forfudan forfudan changed the base branch from main to pre-0.10 April 30, 2026 23:13
@shivasankarka shivasankarka changed the title Add column_stack, concatenate, hstack, vstack, and row_stack [Routines] Add column_stack, concatenate, hstack, vstack, and row_stack May 1, 2026
Implement numpy-compatible array joining routines in
numojo/routines/manipulation.mojo:

- concatenate(): Join arrays along an existing axis
- column_stack(): Stack 1-D arrays as columns into 2-D, or hstack 2-D+ arrays
- row_stack(): Stack arrays vertically (1-D reshaped to (1, N))
- hstack(): Horizontal stacking (axis=0 for 1-D, axis=1 for 2-D+)
- vstack(): Vertical stacking (alias for row_stack)

All functions are exported via numojo.routines and numojo top-level.
Tests validate against numpy equivalents for 1-D, 2-D, 3-D, and
mixed-dimension inputs.
@sauterp sauterp force-pushed the push-mmnplspuxpuq branch from 0b7c7b4 to 8b8b31e Compare May 2, 2026 14:23
@shivasankarka shivasankarka merged commit 874cd0b into Mojo-Numerics-and-Algorithms-group:pre-0.10 May 6, 2026
2 checks passed
shivasankarka pushed a commit to shivasankarka/NuMojo that referenced this pull request May 8, 2026
…ck (Mojo-Numerics-and-Algorithms-group#352)

Implement numpy-compatible array joining routines in
numojo/routines/manipulation.mojo:

- concatenate(): Join arrays along an existing axis
- column_stack(): Stack 1-D arrays as columns into 2-D, or hstack 2-D+
arrays
- row_stack(): Stack arrays vertically (1-D reshaped to (1, N))
- hstack(): Horizontal stacking (axis=0 for 1-D, axis=1 for 2-D+)
- vstack(): Vertical stacking (alias for row_stack)

Tests validate against numpy equivalents for 1-D, 2-D, 3-D, and
mixed-dimension inputs.

Co-authored-by: exedev <exedev@exe.dev>
shivasankarka pushed a commit to shivasankarka/NuMojo that referenced this pull request May 8, 2026
…ck (Mojo-Numerics-and-Algorithms-group#352)

Implement numpy-compatible array joining routines in
numojo/routines/manipulation.mojo:

- concatenate(): Join arrays along an existing axis
- column_stack(): Stack 1-D arrays as columns into 2-D, or hstack 2-D+
arrays
- row_stack(): Stack arrays vertically (1-D reshaped to (1, N))
- hstack(): Horizontal stacking (axis=0 for 1-D, axis=1 for 2-D+)
- vstack(): Vertical stacking (alias for row_stack)

Tests validate against numpy equivalents for 1-D, 2-D, 3-D, and
mixed-dimension inputs.

Co-authored-by: exedev <exedev@exe.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants