Search code examples
pythonpandasdataframecell

Reference of cell value from one dataframe in another dataframe - getting NaN


I am trying to map a particular cell of a bank statement into data frame. When I locate the value it is reading values perfectly, but when I include it into a dataframe it is coming 'NaN'. I would like to bring the balance to new dataframe. Thanks for your support.

Query and output for reference.


Solution

  • Problem is ouput is one element DataFrame, need scalar. So select by scalars instead range:

    info['balance'] = data2.iloc[11, 2]
    

    For last row is possible use -1:

    info['balance'] = data2.iloc[-1, 2]