Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column order and index when stacking/unstacking #78

Open
jnnr opened this issue Oct 14, 2022 · 0 comments
Open

Column order and index when stacking/unstacking #78

jnnr opened this issue Oct 14, 2022 · 0 comments
Milestone

Comments

@jnnr
Copy link
Collaborator

jnnr commented Oct 14, 2022

  • For stacking/unstacking to be reversible, the columns have been sorted. This is not ideal. The index order could be retained when unstacking. However, if some other step is performed with the stacked data, that information would be lost.
  • This has consequences even here!:
    # sort the columns for comparability
    component_df = pd.DataFrame(comp_data).set_index("name")
    component_df = component_df[sorted(component_df.columns)]
  • There is no guarantee that the index of the dataframes is always the same. When load from_csv_dir, DataFramePackage assumes index_col=0.
  • This is connected to
    # TODO: Check if this step is necessary only because function is used differently in some cases.
    _stacked_frame = stacked_frame.reset_index()
@MaGering MaGering added this to the v0.0.3 milestone Sep 19, 2023
@MaGering MaGering modified the milestones: v0.0.3, v0.0.4 Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants