Skip to content

np.hstack() - Stack arrays horizontally #47

@TheWolf313

Description

@TheWolf313

Syntax:
np.hstack((a, b, ...))

Example:
import numpy as np
a = np.array([[1], [2], [3]])
b = np.array([[4], [5], [6]])
stacked = np.hstack((a, b))

[[1 4]
[2 5]
[3 6]]

import numpy as np
x = np.array([1, 2, 3])
y = np.array([4, 5, 6])
result = np.hstack((x, y))
print(result)

[1 2 3 4 5 6]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions