mardi 28 avril 2020

How to create a dataframe with different random numbers on each column?

I'm trying to make different random numbers but it keeps being the same on every column, how to fix it, using 1 line?

CODE:

yuju= pd.DataFrame()
column_price_x = [random.uniform(65.5,140.5) for i in range(20)]
for i in range(1990,2020):
    yuju[i] = column_price_x
yuju

RESULT

result

EXPECTED: Different numbers value for each column

How can I deal with it?




Aucun commentaire:

Enregistrer un commentaire