The dataframe example:
col1, col2, col3
1 v1
2 v2
3 v3
4 v4
5 v5
6 v6
I want to merge col1, col2, col3 to the new column like the following:
col_new
1 v1
2 v2
3 v3
4 v4
5 v5
6 v6
If the dataframe is the following format:
col1, col2, col3
1 v1 v7
2 v2
3 v3
4 v4
5 v5
6 v6
Then, I will not merge these three columns. According to the three columns are not completely complementary. (row - index 1)
Currently, my method transforms three column to list and combine by zip(col1,col2,col3). Then, check each iteration in the list - [x[iteration] for x in list(zip(col1,...))]
Whether "Not Null" item is only one (=1) or not in each iteration? But it seems like an inefficient way.
Is there any efficient way to achieve my requirement?