Teradata Package for Python Function Reference | 20.00 - tail - Teradata Package for Python - Look here for syntax, methods and examples for the functions included in the Teradata Package for Python.
Teradata® Package for Python Function Reference - 20.00
- Deployment
- VantageCloud
- VantageCore
- Edition
- VMware
- Enterprise
- IntelliFlex
- Product
- Teradata Package for Python
- Release Number
- 20.00.00.11
- Published
- August 2026
- ft:locale
- en-US
- ft:lastEdition
- 2026-08-13
- dita:id
- TeradataPython_FxRef_Enterprise_2000
- Product Category
- Teradata Vantage
- teradataml.dataframe.dataframe.DataFrame.tail = tail(self, n=10, deterministic=False)
- DESCRIPTION:
Print the last n rows of the sorted teradataml DataFrame.
PARAMETERS:
n:
Optional Argument.
Specifies the number of rows to select.
Default Value: 10.
Types: int
deterministic:
Optional Argument.
Specifies whether to select the last n rows from the sorted DataFrame or not.
Notes:
* If True, the last n rows of the sorted DataFrame are selected.
The Dataframe is sorted on the index column or the first column if
there is no index column. The column type must support sorting.
Unsupported types: ['BLOB', 'CLOB', 'ARRAY', 'VARRAY']
* If False, a random sample of n rows is selected.
Default Value: False.
Types: bool
RETURNS:
teradataml DataFrame
RAISES:
TeradataMlException
EXAMPLES:
>>> load_example_data("dataframe","admissions_train")
>>> df = DataFrame.from_table('admissions_train')
>>> df
masters gpa stats programming admitted
id
15 yes 4.00 Advanced Advanced 1
7 yes 2.33 Novice Novice 1
22 yes 3.46 Novice Beginner 0
17 no 3.83 Advanced Advanced 1
13 no 4.00 Advanced Novice 1
38 yes 2.65 Advanced Beginner 1
26 yes 3.57 Advanced Advanced 1
5 no 3.44 Novice Novice 0
34 yes 3.85 Advanced Beginner 0
40 yes 3.95 Novice Beginner 0
>>> df.tail()
masters gpa stats programming admitted
id
38 yes 2.65 Advanced Beginner 1
36 no 3.00 Advanced Novice 0
35 no 3.68 Novice Beginner 1
34 yes 3.85 Advanced Beginner 0
32 yes 3.46 Advanced Beginner 0
31 yes 3.50 Advanced Beginner 1
33 no 3.55 Novice Novice 1
37 no 3.52 Novice Novice 1
39 yes 3.75 Advanced Beginner 0
40 yes 3.95 Novice Beginner 0
>>> df.tail(3, deterministic=True)
masters gpa stats programming admitted
id
38 yes 2.65 Advanced Beginner 1
39 yes 3.75 Advanced Beginner 0
40 yes 3.95 Novice Beginner 0
>>> df.tail(15, deterministic=True)
masters gpa stats programming admitted
id
38 yes 2.65 Advanced Beginner 1
36 no 3.00 Advanced Novice 0
35 no 3.68 Novice Beginner 1
34 yes 3.85 Advanced Beginner 0
32 yes 3.46 Advanced Beginner 0
31 yes 3.50 Advanced Beginner 1
30 yes 3.79 Advanced Novice 0
29 yes 4.00 Novice Beginner 0
28 no 3.93 Advanced Advanced 1
27 yes 3.96 Advanced Advanced 0
26 yes 3.57 Advanced Advanced 1
33 no 3.55 Novice Novice 1
37 no 3.52 Novice Novice 1
39 yes 3.75 Advanced Beginner 0
40 yes 3.95 Novice Beginner 0
>>> df.tail(3, deterministic=False)
masters gpa stats programming admitted
id
33 no 3.55 Novice Novice 1
37 no 3.52 Novice Novice 1
20 yes 3.90 Advanced Advanced 1