Skip to content

np.random.randint() - Generate random integers #36

Description

@sahil3028

Syntax:
np.random.randint(low, high=None, size=None, dtype=int)

Arguments:
low, high: Range (high is optional; defaults to [0, low]).
size: Shape of output array.
dtype: Default is int.

Example:
rand_ints = np.random.randint(1, 10, (3, 3))
[[5 2 8]
[7 9 1]
[4 6 3]]

rand_ints_1D = np.random.randint(10, size=5)
[3 7 1 9 5]

Note: cant process argument like (1, 10, (3, 3))

@MimoHasPurpose

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions