T
T
Tem4ikArtem4ik2021-03-29 12:51:48
Python
Tem4ikArtem4ik, 2021-03-29 12:51:48

How to write data in excel spreadsheet to the right cells?

How to write data to the table in the desired cells where, for example, %name% is indicated (in the table) and the python takes a variable and writes it instead of %name%.
Ps %name% is listed as an option, not necessarily there.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2021-03-29
@Tem4ikArtem4ik

import pandas as pd

df = pd.read_excel('file.xlsx', engine='openpyxl')
df = df.replace('%name%', 'John Doe')
df.to_excel('file.xlsx', index=False)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question