0

Data Frame is having two columns

df1
col1 col2
 A    A
 B    B
      C
      D
 E    E
 F    F
      G
      H

here both columns are object type, trying to merge value of column 2 with column 1 where column 1 value is null. how to apply this for large dataset?I'm beginner for panads, trying to learn all the tricks here.

ashish
  • 239
  • 2
  • 6
  • 13
  • see this: https://pandas.pydata.org/pandas-docs/stable/user_guide/merging.html – Raj Verma Feb 05 '20 at 05:20
  • What do you mean, are you asking about `df['col1'].fillna(df['col2'])`? – cs95 Feb 05 '20 at 05:20
  • i tried that but it is not working as i dont want to change any value in colum1 which is present not null, only those values in column 1 which are showing as empty, here both column data type is object. – ashish Feb 05 '20 at 05:26

0 Answers0