Slice rows
Returns a DataFrame
with rows at given indices:
df[0, 3, 4]
Returns a DataFrame
with rows inside given index ranges (including boundary indices):
df[1..2]
df[0..2, 4..5]
take
Returns a DataFrame
containing first n
rows
df.take(5)
takeLast
Returns a DataFrame
containing last n
rows
df.takeLast(5)
takeWhile
Returns a DataFrame
containing first rows that satisfy the given condition
df.takeWhile { isHappy }
drop
Returns a DataFrame
containing all rows except first n
rows
df.drop(5)
dropLast
Returns a DataFrame
containing all rows except last n
rows
df.dropLast() // default 1
df.dropLast(5)
dropWhile
Returns a DataFrame
containing all rows except first rows that satisfy the given condition
df.dropWhile { !isHappy }
Last modified: 27 September 2024