Teradata Python Package Function Reference - std - Teradata Python Package - Look here for syntax, methods and examples for the functions included in the Teradata Python Package.

Teradata® Python Package Function Reference

Product
Teradata Python Package
Release Number
16.20
Published
February 2020
Language
English (United States)
Last Update
2020-07-17
lifecycle
previous
Product Category
Teradata Vantage
teradataml.dataframe.dataframe.DataFrame.std = std(self)
DESCRIPTION:
    Returns column-wise sample standard deviation value of the
    dataframe.
 
PARAMETERS:
    None
 
RETURNS:
    teradataml DataFrame object with std() operation performed.
 
RAISES:
    1. TDMLDF_AGGREGATE_FAILED - If std() operation fails to
        generate the column-wise standard deviation of the
        dataframe.
 
        Possible error message:
        Unable to perform 'std()' on the dataframe.
 
    2. TDMLDF_AGGREGATE_COMBINED_ERR - If the std() operation
        doesn't support all the columns in the dataframe.
 
        Possible error message:
        No results. Below is/are the error message(s):
        All selected columns [(col2 -  PERIOD_TIME), (col3 -
        BLOB)] is/are unsupported for 'std' operation.
 
EXAMPLES :
    # Load the data to run the example.
    >>> from teradataml.data.load_example_data import load_example_data
    >>> load_example_data("dataframe", ["employee_info"])
 
    # Create teradataml dataframe.
    >>> df1 = DataFrame("employee_info")
    >>> print(df1)
                first_name marks   dob joined_date
    employee_no
    101              abcde  None  None    02/12/05
    100               abcd  None  None        None
    112               None  None  None    18/12/05
    >>>
 
    # Select only subset of columns from the DataFrame.
    >>> df2 = df1.select(['employee_no', 'first_name', 'marks', 'dob'])
 
    # Prints standard deviation of each column(with supported data types).
    >>> df2.std()
       std_employee_no std_marks std_dob
    0         6.658328      None    None
    >>>