I'm trying a fill a dataframe column with random string characters - but using the code below I get a new 10 character string each time I run it - but it's the same for every row.
How do I generate a new string for each row?
print(df)
0 eqFSwEJQqD
1 eqFSwEJQqD
2 eqFSwEJQqD
3 eqFSwEJQqD
4 eqFSwEJQqD
...
1019920 eqFSwEJQqD
1019921 eqFSwEJQqD
1019922 eqFSwEJQqD
1019923 eqFSwEJQqD
1019924 eqFSwEJQqD
I'd like, eg:
0 fGtryghjuYt
1 jUiKlOpYtrd
etc...
The code:
import random
from string import ascii_letters
df['ff'] = ''.join(random.choice(ascii_letters) for x in range(10))