Teradata Package for Python Function Reference | 17.10 - count - 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

Product
Teradata Package for Python
Release Number
17.10
Published
April 2022
Language
English (United States)
Last Update
2022-08-19
lifecycle
previous
Product Category
Teradata Vantage
teradataml.geospatial.geodataframe.GeoDataFrame.count = count(self, distinct=False)
DESCRIPTION:
    Returns column-wise count of the GeoDataFrame.
 
PARAMETERS:
    distinct:
        Optional Argument.
        Specifies whether to exclude duplicate values while calculating the count.
        Default Value: False
        Types: bool
 
RETURNS:
    teradataml GeoDataFrame object with count() operation
    performed.
 
RAISES:
    TeradataMLException
    1. EXECUTION_FAILED - If count() operation fails to
        generate the column-wise count of the GeoDataFrame.
 
        Possible error message:
        Failed to perform 'count'. (Followed by error message).
 
    2. TDMLDF_AGGREGATE_COMBINED_ERR - If the count() operation
        doesn't support all the columns in the GeoDataFrame.
 
        Possible error message:
        No results. Below is/are the error message(s):
        All selected columns [(col2 -  PERIOD_TIME), (col3 -
        BLOB)] is/are unsupported for 'count' operation.
 
EXAMPLES :
    # Load the data to run the example.
    from teradataml.data.load_example_data import load_example_data
    load_example_data("GeoDataFrame", ["sample_shapes"])
 
    # Create teradataml GeoDataFrame.
    df1 = GeoDataFrame("sample_shapes")
    print(df1)
 
    # Prints count of the values in all the selected columns
    # (excluding None types).
    df1.count()