Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

62%
+3 −1
Q&A Comparing two excel files with Python based on changes

I have two tables: Table1: Name Description Amount 123 Description123 123 456 Description456 456 789 Description789 666 101 Description777 101 133 De...

1 answer  ·  posted 3y ago by sfrow‭  ·  last activity 3y ago by ibmx‭

Question python pandas
#1: Initial revision by user avatar sfrow‭ · 2021-12-14T15:00:18Z (about 3 years ago)
Comparing two excel files with Python based on changes
I have two tables:

<b>Table1:</b>


| Name| Description | Amount| 
| --- | --- | --- | 
| 123 | Description123 | 123 |
| 456 | Description456 | 456|
| 789 | Description789  | 666|
| 101 | Description777  | 101 |
| 133 | Description133  | 133 |

<b>Table2:</b>

| Name| Description | Amount| 
| --- | --- | --- | 
| 456| Description456 | 456|
| 789 | Description789  | 789|
| 101 | Description101  | 101|
| 123 | Description123  | 123 |
| 102| Description102  | 102|

<br>

I need to find the difference in **Table1** compared it from **Table2**. The connection between these 2 excel files will be the column **Name**.
Expected output is if something is changed in **Table 2** the data must be used from **Table 2** and if there is new rows from **Table 2** they must be added to the final result. If nothing is also changed or **Table 2** doesn't have any data for specific **Name** from **Table 1** like **133** the rows also need to be added to the final result.
<br>
<br>
<b>Expected output:</b>

| Name| Description | Amount| 
| --- | --- | --- | 
| 123| Description123 | 123|
| 456| Description456  | 456|
| 789| Description789  | 789|
| 101| Description101  | 101|
| 102| Description102  | 102|
| 133| Description133  | 133|


Thanks in advance! <br>

Edit1: I struggle to find the solution. I understand how to compare each rows in the excel files, but they need to have exactly the same order in **Name** column. I don't know how to do it if there is no order like this specific case above.