Teradata Package for Python Function Reference on VantageCloud Lake - floor - 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 on VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Package for Python
Release Number
20.00.00.04
Published
March 2025
ft:locale
en-US
ft:lastEdition
2025-04-11
dita:id
TeradataPython_FxRef_Lake_2000
Product Category
Teradata Vantage
teradataml.dataframe.sql.DataFrameColumn.floor = floor()
DESCRIPTION:
    Function returns the largest integer equal to or less than the value in the column of DataFrame.
 
RAISES:
    TypeError, ValueError, TeradataMlException
 
RETURNS:
    DataFrameColumn
 
EXAMPLES:
    # Load the data to execute the example.
    >>> load_example_data("dataframe", "admissions_train")
 
    # Create a DataFrame on 'admissions_train' table.
    >>> df = DataFrame("admissions_train").iloc[:4]
    >>> print(df)
       masters   gpa     stats programming  admitted
    id
    3       no  3.70    Novice    Beginner         1
    4      yes  3.50  Beginner      Novice         1
    2      yes  3.76  Beginner    Beginner         0
    1      yes  3.95  Beginner    Beginner         0
 
    # Example 1: Calculates floor() value for the "gpa" column and pass as input to
    #            DataFrame.assign().
    >>> res = df.assign(col = df.gpa.floor())
    >>> print(res)
       masters   gpa     stats programming  admitted  col
    id
    3       no  3.70    Novice    Beginner         1  3.0
    4      yes  3.50  Beginner      Novice         1  3.0
    2      yes  3.76  Beginner    Beginner         0  3.0
    1      yes  3.95  Beginner    Beginner         0  3.0
 
    # Example 2: Executed floor() function on "gpa" column and filtered computed values
    #            which are equal to 3.0.
    >>> print(df[df.gpa.floor() == 3.0])
       masters   gpa     stats programming  admitted
    id
    3       no  3.70    Novice    Beginner         1
    4      yes  3.50  Beginner      Novice         1
    2      yes  3.76  Beginner    Beginner         0
    1      yes  3.95  Beginner    Beginner         0