-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
Sticky header and index for large data frames in Jupyter #29072
Comments
Have you tried using qgrid or beakerx? https://github.com/quantopian/qgrid |
I tried qgrid but I haven't tried beakerx. I would also prefer the sticky header and index as the default for displaying the dataframe since I often want to inspect the data, fx. after loading a CSV file. Using Jupyter Lab and a dataframe with many rows would result in a very long notebook. In the classical notebook the output can be made into horizontal scroll, but without have a sticky header and index. |
This is already possible if you know the CSS solution:
I dont think this is worth API but a mention in docs. Ill leave open until then |
[updated with solution] Looks like set_table_styles doesn't accept that kind of string anymore. It worked for me with ...
|
@dsjstc sorry I gave you the new 1.3.0 input format for release June 2021, which is more CSS friendly. |
how about if I have multi-index? |
then you need to define the sticky positions for each index level so they dont overlap e.g:
|
@attack68 , I still can not understand how to set the size of a frame that will have scrolls... Can it be done in 1.3.2 that I'm using? |
set sticky uses css that works for the table within the frame or container you place it in. The css is quite simple, build a simple dataframe, set it sticky and observe the rules. you cannot control the size of the frame/container from pandas |
How do I set a custom Pandas dataframe width for a specific column, say the column named Description within the sticky header template or using CSS in general? |
Problem description
When displaying a large data frame in Jupyter the number of columns will be limited by
max_cols
set in the default setting, and all the rows will be displayed.I would like to add an option in the default settings so that large data frames will be displayed with a sticky header and index and then be able to scroll though the data frame.
Proof of concept solution
Following the solution for html tables found at Stackoverflow: Table with fixed header and fixed column on pure css with the solution shown in action here HTML and CSS Solution
I came up with the following solution (which follows the same way of
<style scoped>
as the_repr_html_
method):I would therefore like to know if others also would like to have this feature in pandas?
Otherwise I guess I would make it to an independent module that wraps the
_repr_html_
method.I know that it is not just a matter of adding the new styling above for the general case, but the above solution is a minimal working solution.
A related issues is #28091
The text was updated successfully, but these errors were encountered: