diff --git a/python/cudf/cudf/core/dataframe.py b/python/cudf/cudf/core/dataframe.py index 7b18e405b7c..f7fd2238a50 100644 --- a/python/cudf/cudf/core/dataframe.py +++ b/python/cudf/cudf/core/dataframe.py @@ -4089,10 +4089,11 @@ def transpose(self): if any(c.dtype != source_columns[0].dtype for c in source_columns): raise ValueError("Columns must all have the same dtype") - input_table = plc.table.Table( - [col.to_pylibcudf(mode="read") for col in source_columns] + result_table = plc.transpose.transpose( + plc.table.Table( + [col.to_pylibcudf(mode="read") for col in source_columns] + ) ) - result_table = plc.transpose.transpose(input_table) result_columns = [ libcudf.column.Column.from_pylibcudf(col, data_ptr_exposed=True) for col in result_table.columns()