Random generation of integers number with some specific characteristics

Viewed 28

I am trying to generate random integer values in the chi-squared distribution. Below you can see my code.

import numpy as np
import matplotlib.pyplot as plt
import random

# Using chisquare() method
gfg = np.random.chisquare(3, 1000)

df_chi = pd.DataFrame(gfg, columns = ['Column_A'])

df_chi.describe()
count, bins, ignored = plt.hist(gfg, 14, density = True)
plt.show()

This code generates random values in the chi-square distribution. Now I want to create random values in the chi-square distribution but some specific characteristics, such as:

Number of rows: 100000
Minimum values: 0
Maximum values: 99999999
Mean: 30000
Standard deviation: 500000

Can anybody help me how to do this?

0 Answers
Related