Teradata Package for Python Function Reference | 17.10 - set_link - 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.geodataframecolumn.GeoDataFrameColumn.set_link = set_link(self, index, link_id)
DESCRIPTION:
    Set the link ID of a specified point in a GeoSequence.
 
PARAMETERS:
    index:
        Required Argument.
        Specifies the index of the point in the GeoSequence, where the index of the
        first point is 1.
        Types: int, str, ColumnExpression
 
    link_id:
        Required Argument.
        Specifies the new link ID of the specified point in the GeoSequence. The data type
        of linkID is DECIMAL(18,0).
        Types: float
 
SUPPORTED GEOMETRY TYPES:
    GeoSequence
 
RAISES:
    TypeError, ValueError, TeradataMlException
 
RETURNS:
    GeoDataFrameColumn
 
EXAMPLES:
    from teradataml import GeoDataFrame, load_example_data
    from teradataml import Point, LineString, Polygon, GeometryCollection
    # Load example data.
    load_example_data("geodataframe", "sample_shapes")
    # Create a GeoDataFrame.
    geodf = GeoDataFrame("sample_shapes")
    print(geodf)
 
    # Example 1: Set the link ID for the point at the 1st index in geometries in column 'geosequence'.
    # Let's select only few columns from GeoDataFrame.
    geoseq = geodf.select(["skey", "geosequence"])[geodf.skey.isin([1001, 1002])]
    geoseq.assign(res = geoseq.geosequence.set_link(index=1, link_id=20.2))