If I have a df
like this one down below:
0 0 1 1 2 2 3 3 4 4 5 5
0 Fondo Oceano Cuerpo Cuerpo cangrejo Ojos Antenas Color Amarillo Pinzas None Puas None
1 Fondo Oceano Cuerpo Cuerpo cangrejo Ojos Antenas Color Amarillo Pinzas None Puas Arena
2 Fondo Oceano Cuerpo Cuerpo cangrejo Ojos Antenas Color Amarillo Pinzas None Puas Marron
3 Fondo Oceano Cuerpo Cuerpo cangrejo Ojos Antenas Color Amarillo Pinzas None Puas Purpura
How can I get the last element from a row like 0
without having to iterate over the row nor using the name of the last columns (5
in this case)?
Expected Output for the row 0:
None
You can do that with the following
df[df.columns[-1]][0]