Teradata Package for Python Function Reference on VantageCloud Lake | 17.20 - index - 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.index
DESCRIPTION:
    Returns the index_label of the teradataml GeoDataFrame.
 
RETURNS:
    str or List of Strings (str) representing the index_label of the GeoDataFrame.
 
RAISES:
    None
 
EXAMPLES:
    >>> load_example_data("geodataframe","sample_cities")
    >>> df = GeoDataFrame("sample_cities")
    >>> df
           city_name                                 city_shape
    skey
    1        Seaside  POLYGON ((10 10,10 20,20 20,20 15,10 10))
    0     Oceanville            POLYGON ((1 1,1 3,6 3,6 0,1 1))
    >>>
    # Get the index_label
    >>> df.index
    ['skey']
    >>>
    # Set new index_label
    >>> df = df.set_index(['city_shape', 'city_name'])
    >>> df
                                                          skey
    city_name  city_shape
    Seaside    POLYGON ((10 10,10 20,20 20,20 15,10 10))     1
    Oceanville POLYGON ((1 1,1 3,6 3,6 0,1 1))               0
    >>>
    # Get the index_label
    >>> df.index
    ['city_name', 'city_shape']
    >>>