Giter VIP home page Giter VIP logo

Comments (6)

MarkNOakden avatar MarkNOakden commented on July 18, 2024 3

The point is that other dataframe display methods (e.g. to_html()) accept a parameter (index=False) which hides the index column in the resulting html (which you can then render in the notebook using display()). It would be good if qgrid allowed a similar parameter to suppress the index display.

from qgrid.

JohnOmernik avatar JohnOmernik commented on July 18, 2024 1

You can do this:
q = qgrid.show_grid(mydf, column_definitions={ 'index': { 'maxWidth': 0, 'minWidth': 0, 'width': 0 } })

I wish this was a qgrid level option do I didn't have all that on my display, but this DOES work.

from qgrid.

TimShawver avatar TimShawver commented on July 18, 2024

Sorry I don't believe there is a way to do this currently. You'll have to remove the column from the DataFrame if you don't want it to appear in the grid. This would be a nice convenience feature to add though, so thanks for filing the issue.

from qgrid.

markolopa avatar markolopa commented on July 18, 2024

Thanks. Is there a way to remove it from the DataFrame? If I understand correctly the row name qgrid column is not a DataFrame column.

from qgrid.

TimShawver avatar TimShawver commented on July 18, 2024

I may have misunderstood the question. Can you look at the sample notebook here and tell me if either of the examples there have the problem you're talking about? http://nbviewer.jupyter.org/gist/TimShawver/b4bc80d1128407c56c9a

I'm guessing the second example might be what you're talking about, i.e. how a numbered "index" column appears when your DataFrame is lacking an index. You'll notice that the column is also in the default rendering of the DataFrame though, so it's the correct behavior by Qgrid. It's impossible to have a DataFrame without an index, so when you don't specify one yourself, pandas adds one for you.

It might be that the workaround for your specific issue would be to use one of the existing columns in the DataFrame as the index. This stackoverflow article shows how to set the index of your DataFrame to an existing column.

from qgrid.

shadiakiki1986 avatar shadiakiki1986 commented on July 18, 2024

q = qgrid.show_grid(mydf, column_definitions={ 'index': { 'maxWidth': 0, 'minWidth': 0, 'width': 0 } })

This still shows a few pixels from the column

from qgrid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.