I have Dataframe df as shown below: For every row columns with value None should be replaced with columns 2 , 3, 4 ,5 values from dataframe.
ID 1 2 3 4 5 col0 col1 col2 col3 col4 col5 col6
0 A1 ABC RED1 RED2 RED3 RED4 10 20 None None None None None
1 B1 ABC OR1 OR2 OR3 OR4 40 None None None None None None
2 C1 ABC WHITE1 WHITE2 WHITE3 WHITE4 50 34 35 57 78 98 None
3 D1 ABC BLUE1 BLUE2 BLUE3 BLUE4 20 None None None None None None
I Want output:
ID 1 col0 col1 col2 col3 col4 col5 col6 NEW1 NEW2 NEW3 NEW4
0 A1 ABC 10 20 RED1 RED2 RED3 RED4
1 B1 ABC 40 OR1 OR2 OR3 OR4
2 C1 ABC 50 34 35 57 78 98 99 WHITE1 WHITE2 WHITE3 WHITE4
3 D1 ABC 20 BLUE1 BLUE2 BLUE3 BLUE4