# Randint

How to sample numbers from a range of integers uniformly.

#### New to Plotly?¶

Plotly's Python library is free and open source! Get started by downloading the client and reading the primer.

You can set up Plotly to work in online or offline mode, or in jupyter notebooks.

We also have a quick-reference cheatsheet (new!) to help you get started!

In [1]:

```
import plotly.plotly as py
import plotly.graph_objs as go
import numpy as np
```

#### Randint¶

`np.random.randint()`

allows users to pick uniformly from a set of integers [`low`

, `low + 1`

, ..., `high`

].

In [2]:

```
import plotly.plotly as py
import plotly.graph_objs as go
num_of_points = 200
random_numbers = np.random.randint(0, 10, num_of_points)
trace1 = go.Scatter(
x=[j for j in range(num_of_points)],
y=random_numbers,
mode='markers',
marker = dict(
size=7,
color=random_numbers,
colorscale='Jet',
symbol='diamond'
),
name='Numbers sampled from 0 to 9'
)
py.iplot([trace1], filename='numpy-randint')
```

Out[2]:

In [3]:

```
help(np.random.randint)
```