Back
I have an excel file containing a column of 'Usernames' and I want to copy-paste that data into the adjacent column in the same sheet and call it 'Passwords'. All this must be done in a Python program.
You can use pandas to read the excel sheet and then copy the column username to a new column called password and then save it with the same name.
You can do it like this:
df = pd.read_excel('testsheet.xlsx')df['password'] = df['username']df.to_excel("testsheet.xlsx", index=False)
df = pd.read_excel('testsheet.xlsx')
df['password'] = df['username']
df.to_excel("testsheet.xlsx", index=False)
31k questions
32.8k answers
501 comments
693 users