diff --git a/tensorflow/python/estimator/inputs/pandas_io.py b/tensorflow/python/estimator/inputs/pandas_io.py index a4963542679..af8030701be 100644 --- a/tensorflow/python/estimator/inputs/pandas_io.py +++ b/tensorflow/python/estimator/inputs/pandas_io.py @@ -111,7 +111,7 @@ def pandas_input_fn(x, raise ValueError('Index for x and y are mismatched.\nIndex for x: %s\n' 'Index for y: %s\n' % (x.index, y.index)) if isinstance(y, pd.DataFrame): - y_columns = [(column, _get_unique_target_key(x, column)) + y_columns = [(column, _get_unique_target_key(x, column)) for column in list(y)] target_column = [v for _, v in y_columns] x[target_column] = y