Good Day Everyone!
So got to do something probably a million times in this project which I just don't understand.
For example look at the dataset here:
What I most specifically need are the first 20 usernames so from index 0:20 and these need to go to the Sponsor column which can be seen here:
What this dataset does is build a genealogy that I'm trying to achieve here.
Kindly help if you can
Try this and let us know your output
u_names = df.Username.values[:20]
for idx, row in df.loc[20:40].iterrows():
row['MainSponsor'] = u_names[idx]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.