dpnp.random.Generator.zipf

method

Generator.zipf(a, size=None, *, usm_type=None)[source]

Draw samples from a Zipf distribution.

For full documentation refer to numpy.random.Generator.zipf.

Parameters:
a{float, array_like of floats, dpnp.ndarray, usm_ndarray}

The distribution parameter, greater than 1.

size{None, int, tuple of ints}, optional

Output shape. With None, the broadcast shape of a.

Default: None.

usm_type{None, "device", "shared", "host"}, optional

The type of SYCL USM allocation for the output array.

Default: None, which means the USM type of the array parameters, or "device" when there are none.

Returns:
outdpnp.ndarray

The samples, of data type dpnp.int64.

Limitations

usm_type is not in NumPy's signature. The samples follow the Zipf distribution truncated to the largest int64, while NumPy's rejection test rounds to accepting every sample above 2**53, which makes its tail too heavy for a close to 1.