2015-08-12 16 views

risposta

33

È possibile utilizzare head

df.head().getInt(0) 

o first

df.first().getInt(0) 

check DataFrame docs Scala per maggiori dettagli

+0

Nota: 'prima()' è un alias per 'testa() '. (per altri che leggono qui) – Czechnology

2

Questo potrebbe risolvere il tuo problema.

df.map{ 
    row => row.getInt(0) 
}.first() 
Problemi correlati