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

Teradata® Python Package User Guide

Product
Teradata Python Package
Release Number
16.20
Published
February 2020
Language
English (United States)
Last Update
2020-02-29
dita:mapPath
rkb1531260709148.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.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)