Teradata Package for Python Function Reference on VantageCloud Lake - log10 - 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.03
Published
December 2024
ft:locale
en-US
ft:lastEdition
2024-12-19
dita:id
TeradataPython_FxRef_Lake_2000
Product Category
Teradata Vantage
teradataml.dataframe.sql.DataFrameColumn.log10 = log10()
DESCRIPTION:
    Function returns the base 10 logarithm of the values in column.
 
NOTES:
    1. If the type of the column is not FLOAT, column values are converted to FLOAT
       based on implicit type conversion rules. If the value cannot be converted, an
       error is reported. For more information on implicit type conversion,
       see Teradata Vantage™ Data Types and Literals.
    2. Unsupported column types:
        a. BYTE or VARBYTE
        b. LOBs (BLOB or CLOB)
        c. CHARACTER or VARCHAR if the server character set is GRAPHIC
 
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: Computes logarithm of values in "gpa" and "gpa" * 10 and pass it
    #            as input to DataFrame.assign().
    >>> res = df.assign(col = df.gpa.log10(),
    ...                col_mul = (df.gpa*10).log10())
    >>> print(res)
       masters   gpa     stats programming  admitted       col   col_mul
    id
    3       no  3.70    Novice    Beginner         1  0.568202  1.568202
    4      yes  3.50  Beginner      Novice         1  0.544068  1.544068
    2      yes  3.76  Beginner    Beginner         0  0.575188  1.575188
    1      yes  3.95  Beginner    Beginner         0  0.596597  1.596597
 
    # Example 2: Executed log10() function on "gpa" column and filtered computed
    #            values which are greater than 0.57.
    >>> print(df[df.gpa.log10() > 0.57])
       masters   gpa     stats programming  admitted
    id
    2      yes  3.76  Beginner    Beginner         0
    1      yes  3.95  Beginner    Beginner         0