mardi 16 février 2021

Generate random numbers from a particular column

I have a dataset in this form

item_id  EAN   Price
3434     232    34
3233     412    28

There are totally 54344 datapoints.

I want to random print 40 values from EAN. I tried some techniques like

df=pd.read_csv('item_desc.csv')
print(df['EAN'].random.rand(40))

but it doesn't worked. Can someone suggest me the code




Aucun commentaire:

Enregistrer un commentaire