Expected ResultActual Result3Firstly Both the columns are different with different data. Gathering these columns data from 2 different sheets and adding those collected columns in a new excel sheet. While writing to an excel sheet i can see BLANK cells.Below is the sample o/p i got. Table Please Find the attached snippet for reference (Actual & Expected Results)
import pandas as pd
data1 = pd.read_csv(r'File1.dat', sep='|')
df1 = data1.loc[:, ['Sheet1_Col1']].drop_duplicates()
data2 = pd.read_excel(r'File2.xlsx')
df2= data2[data2['Sheet2_Col2'] == 'Number'].loc[:,'SOURCE_CODE'].drop_duplicates()
df_all_rows = pd.concat([df1,df2], axis=1)
after_concat = df_all_rows.to_excel('New_Sheet.xlsx', sheet_name='Collected_columns', index=False)
Expected Result is columns collected from 2 different excel sheets should be able to add these collected data in a new excel sheet