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

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for Python
Release Number
20.00
Published
March 2024
Language
English (United States)
Last Update
2024-04-10
dita:id
TeradataPython_FxRef_Enterprise_2000
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']
    >>>