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
When melting a dataframe, there's no option to keep the original index. This can be beneficial for example when users want to do different kind ravel than the deault F (Fortran style) right now. To make this more clear, see example:
Solution proposal
This could be solved by adding an ignore_index argument which is True by default, but if it is set to False, the result would come out like:
variablevalue0A11A40B21B50C31C6
This way the user can sort the index themself and achieve the same result:
Also in pandas/core/reshape/melt there is an # TODO: what about the existing index? in the melt function. This might solve that TODO if I'm not mistaken.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
When melting a dataframe, there's no option to keep the original index. This can be beneficial for example when users want to do different kind
ravel
than the deaultF
(Fortran style) right now. To make this more clear, see example:But the expected output can be row wise instead:
Solution proposal
This could be solved by adding an
ignore_index
argument which isTrue
by default, but if it is set toFalse
, the result would come out like:This way the user can sort the index themself and achieve the same result:
Also in
pandas/core/reshape/melt
there is an# TODO: what about the existing index?
in themelt
function. This might solve that TODO if I'm not mistaken.The text was updated successfully, but these errors were encountered: