I set up a simple DataFrame in pandas:
a = pandas.DataFrame([[1,2,3], [4,5,6], [7,8,9]], columns=[\'a\',\'b\',\'c\']) >>> print a a b c 0 1 2
Taking elements from the solutions of @PallavBakshi and @Mike, the following works in Pandas >= 0.19
Just using iloc[-1, 'a] won't work as -1 is not in the index.
a.loc[a.index[-1], 'a']= 4.0