You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now df.transpose() infers the resulting dtype, which for mixed types usually ends up being strings or lists of strings. Would it be possible to add a parameter to .transpose() to allow for object dtypes, where the rows are not casted at all? Just as an example with something like as_object:
As for the use case, personally, I was asked to create a table of a transposed df using great-tables. The automatic casting to strings of mixed columns means that I can't make use of great-tables built in number formatting methods. So instead I need to either recast the rows back to their original dtype or format the df using polars before transposing.
The text was updated successfully, but these errors were encountered:
Can I add another use case? Many financial reports have the dates flow horizontally across the worksheet. All manipulation etc can be done in polars but final report being pushed to Excel. So please add my vote for this enhancement.
Description
Right now
df.transpose()
infers the resulting dtype, which for mixed types usually ends up being strings or lists of strings. Would it be possible to add a parameter to.transpose()
to allow for object dtypes, where the rows are not casted at all? Just as an example with something likeas_object
:df =
shape: (1, 4)
df_transposed =
shape: (4, 2)
df_object=
shape: (4, 2)
As for the use case, personally, I was asked to create a table of a transposed df using great-tables. The automatic casting to strings of mixed columns means that I can't make use of great-tables built in number formatting methods. So instead I need to either recast the rows back to their original dtype or format the df using polars before transposing.
The text was updated successfully, but these errors were encountered: