Suppose I have a DataFrame, for example:
df = pd.DataFrame(np.random.randn(10,5), columns = ['a','b','c','d','e'])
and I would like to get the last value in column e. I could do:
df['e'].tail(1)
but that will return a series with index 9. Ideally, I just want to get the value as a number that I can work directly with. I could also do:
np.array(df['e'].tail(1))
but then I will need to access / call the 0th element before I can work with it. Is there a more direct / easy way to do this?
source share