index=[' '' '' '' '' '' ']in [ ] series(np arange(len( )dtype=np float )index=[' '' '' '' '' '' ']in [ ] [- np nan in [ ] out[ ] nan nan nan in [ ] out[ ] nan in [ ]np where(pd isnull( )baout[ ] nan series has combine_first methodwhich performs the equivalent of this operation plus data alignmentin [ ] [:- combine_first( [ :]out[ ] nan with dataframescombine_first naturally does the same thing column by columnso you can think of it as "patchingmissing data in the calling object with data from the object you passin [ ]df dataframe({' '[ np nan np nan]' '[np nan np nan ]' 'range( )}in [ ]df dataframe({' '[ np nan ]' '[np nan ]}in [ ]df combine_first(df out[ ] nan nan reshaping and pivoting there are number of fundamental operations for rearranging tabular data these are alternatingly referred to as reshape or pivot operations reshaping and pivoting www it-ebooks info