How can we use Coalesce with multiple data frames.
columns_List = Emp_Id, Emp_Name, Dept_Id...
I have two data frames getting used in python script. df1[Columns_List] , df2[columns_List]. In both the dataframes i have same columns used but i will be having different values in both dataframes.
How can i use Coalesce so that lets say :In Dataframe df1[Columns_List] -- I have Emp_Name null then i want to pick Emp_Name from df2[Columns_list].
I am trying to create an output CSV file.
Please sorry if my framing of question is wrong..
Please find below sample data.
For Dataframe1 -- df1[Columns_List] .. Please find below output
EmpID,Emp_Name,Dept_id,DeptName
1,,1,
2,,2,
For Dataframe2 -- df2[Columns_List] .. Please find below output
EmpID,Emp_Name,Dept_id,DeptName
1,XXXXX,1,Sciece
2,YYYYY,2,Maths
I have source as Json file. Once i parse the data by python , i am using 2 dataframes in the same script. In Data frame 1 ( df1) i have Emp_Name & Dept_Name as null. In that case i want to pick data from Dataframe2 (df2).
In the above example i have provided few columns. But i may have n number of columns. but column ordering and column names will be always same. I am trying to achieve in such a way if any of the column from df1 is null then i want to pick value from df2.
Is that possible.. Please help me with any suggestionn...