T
T
TotSam7772021-01-19 22:28:15
Python
TotSam777, 2021-01-19 22:28:15

How to compare in Python 2 excel files?

Good day ! Currently interested in learning the programming language Python (previously had nothing to do with programming). I study it at the rate of Andrey Kudlai. I would like to bring to life a small program that will read 2 or more excel files, find matches in them by columns or rows, and output the result to a new excel file. I read several articles about modules for working with excel, documentation, but I still can’t understand what and how to do. Please, help with the code or tell me with an example... Thank you!
PS Patience and work will grind everything!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ihor, 2021-01-21
@TotSam777

Good afternoon
I advise you to use the pandas library In order to open an excel file: To display the column names: You can open several excel files and compare their columns (and their value). The pandas library is quite extensive, so it's better to read the theory and then use it to solve problems.
import pandas as pd
df = pd.read_excel('file.xlsx')
df.columns

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question