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

Index column in GBTFITSLoad.summary() #78

Open
astrofle opened this issue Aug 25, 2023 · 4 comments
Open

Index column in GBTFITSLoad.summary() #78

astrofle opened this issue Aug 25, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@astrofle
Copy link
Collaborator

Personally, I find it confusing to have the index column shown when using GBTFITSLoad.summary(verbose=False).
However I have not been able to find a way of returning a pandas.DataFrame without an index, only printing (e.g., print(df.to_string(index=False))).
I like the ability of accessing the summary as a pandas.DataFrame, so just printing the summary seems like a poor solution.
Any ideas on how to tackle this are welcome.

@astrofle astrofle added the enhancement New feature or request label Aug 25, 2023
mpound added a commit that referenced this issue Nov 16, 2023
@mpound
Copy link
Collaborator

mpound commented Nov 16, 2023

fixed with new show_index keyword to summary(), default: False.
this calls df.style.hide(axis='index')

@mpound mpound closed this as completed Nov 16, 2023
@astrofle
Copy link
Collaborator Author

astrofle commented Nov 21, 2023

When I tried this in IPython shell but it did not print the index. It returned a function:

sdfits.summary()
   <pandas.io.formats.style.Styler at 0x7f0e78728410>

This is using pandas==2.1.3, when installing dysh==0.2.0rc

@astrofle astrofle reopened this Nov 21, 2023
@astrofle
Copy link
Collaborator Author

Using:

if not show_index:
    print(compressed_df.to_string(index=False))

works in notebooks and the shell, however it does not look pretty in the notebooks. I'll leave it like this for now.

I'll leave the issue open, in case anyone wants to dig deeper, but this is not a priority.

@mpound
Copy link
Collaborator

mpound commented Nov 21, 2023

Yeah, I originally had it like that but it looked ugly in notebooks. I did not consider that it would not work in ipython.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants