BaşlayınÜcretsiz Başlayın

Generating random numbers

You've used .sample() to generate pseudo-random numbers from a set of values in a DataFrame. A related task is to generate random numbers that follow a statistical distribution, like the uniform distribution or the normal distribution.

Each random number generation function has distribution-specific arguments and an argument for specifying the number of random numbers to generate.

matplotlib.pyplot is loaded as plt, and numpy is loaded as np.

Bu egzersiz

Sampling in Python

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Generate random numbers from a Uniform(-3, 3)
uniforms = ____

# Print uniforms
print(uniforms)
Kodu Düzenle ve Çalıştır