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

Deployment
VantageCloud
Edition
Lake
Product
Teradata Package for Python
Release Number
17.20
Publication Date
November 2022
Content Type
Programming Reference
Publication ID
B700-4500-112K
ft:locale
en-US
ft:lastEdition
2024-02-21
ft:sourceId
FTML
dita:id
TeradataPython_FxRef_Lake_1720
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()