Skip to content

Instantly share code, notes, and snippets.

View ManojDatt's full-sized avatar

Manoj datt ManojDatt

View GitHub Profile
@ManojDatt
ManojDatt / main.py
Last active April 10, 2024 11:12
We have qa, uat and prod 3 csv files with co_type, co_name, co_description, co_id, Source columns we wanted to compine these based on co_type, with priority of prod file, if prod has same co_type that qa and uat has then use from prod if not the use from qa and then from uat and finally combined data save in a separate csv file Make use of pytho…
import pandas as pd
# Read Excel files
df1 = pd.read_csv('uat.csv')
df2 = pd.read_csv('qa.csv')
df3 = pd.read_csv('prod.csv')
# Add source column
df1['source'] = 'UAT'
df2['source'] = 'QA'
df3['source'] = 'PROD'
df1 = df1.drop('co_id', axis=1)