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

Teradata® Package for Python User Guide

Product
Teradata Package for Python
Release Number
17.10
Published
May 2022
Language
English (United States)
Last Update
2022-08-18
dita:mapPath
rsu1641592952675.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
B700-4006
lifecycle
previous
Product Category
Teradata Vantage

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)