cudf.DataFrame.tail#
- DataFrame.tail(n=5)[source]#
Returns the last n rows as a new DataFrame or Series
Examples
DataFrame
>>> import cudf >>> df = cudf.DataFrame() >>> df['key'] = [0, 1, 2, 3, 4] >>> df['val'] = [float(i + 10) for i in range(5)] # insert column >>> df.tail(2) key val 3 3 13.0 4 4 14.0
Series
>>> import cudf >>> ser = cudf.Series([4, 3, 2, 1, 0]) >>> ser.tail(2) 3 1 4 0