select() Method Requires Unique Column Names | Teradata Python Package - select() Method Requires Unique Column Names - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

The select method does not handle identical column names being passed as arguments.

For example:

>>> df = DataFrame('table1')
>>> df.select(['col1', 'col1'])

To work around, use the assign method to provide an alias.

# c1 and c2 both refer to the col1 column
>>> df.assign(c1 = df.col1, c2 = df.col1)