Cities = ['Acre','Ashdod','Ashqelon','Bat Yam','Beersheba','Bnei Brak','Caesarea','Dimona','Dor','Elat','Kefar Sava','Lod','Meron','Nahariyya','Nazareth','Netanya']
lst = []
for i in range(500):
i = random.choice(Cities)
print(i)
lst.append(i)
Data.loc[(Data['country'] == 'Israel') & (Data['state'] == 0),'state'] = lst
I tried this method. In this code list some city of israel and generate 500 random value of it. And apply condition to insert data in israel state location where data is 0.
Aucun commentaire:
Enregistrer un commentaire