Qgrid API Documentation

Qgrid is an IPython widget which uses SlickGrid to render pandas DataFrames within a Jupyter notebook.

Other qgrid resources

This page hosts only the API docs for the project. You might also be interested in these other qgrid-related resources:

qgrid on GitHub
This is where you’ll find the source code and the rest of the documentation for the project, including the instructions for installing and running qgrid.
qgrid demo on nbviewer
See a demo of qgrid in your browser without installing anything. The functionality of qgrid is somewhat limited in this environment, but it’ll give you an idea of how the grid will look and feel when you install it locally.

qgrid Module

qgrid.set_defaults(show_toolbar=None, remote_js=None, precision=None, grid_options=None)

Set the default qgrid options. The options that you can set here are the same ones that you can pass into show_grid. See the documentation for show_grid for more information.


This function will be useful to you if you find yourself setting the same options every time you make a call to show_grid. Calling this set_defaults function once sets the options for the lifetime of the kernel, so you won’t have to include the same options every time you call show_grid.

See also

The function whose default behavior is changed by set_defaults.
qgrid.set_grid_option(optname, optvalue)

Set the default value for one of the options that gets passed into the SlickGrid constructor.

  • optname (str) – The name of the option to set.
  • optvalue (object) – The new value to set.


The options you can set here are the same ones that you can set via the grid_options parameter of the set_defaults or show_grid functions. See the SlickGrid documentation for the full list of available options.

qgrid.show_grid(data_frame, show_toolbar=None, remote_js=None, precision=None, grid_options=None)

Main entry point for rendering DataFrames as SlickGrids.

  • grid_options (dict) – Options to use when creating javascript SlickGrid instances. See the Notes section below for more information on the available options, as well as the default options that qgrid uses.
  • remote_js (bool) – Whether to load slickgrid.js from a local filesystem or from a remote CDN. Loading from the local filesystem means that SlickGrid will function even when not connected to the internet, but grid cells created with local filesystem loading will not render correctly on external sharing services like NBViewer.
  • precision (integer) – The number of digits of precision to display for floating-point values. If unset, we use the value of pandas.get_option(‘display.precision’).
  • show_toolbar (bool) – Whether to show a toolbar with options for adding/removing rows and exporting the widget to a static view. Adding/removing rows is an experimental feature which only works with DataFrames that have an integer index. The export feature is used to generate a copy of the grid that will be mostly functional when rendered in nbviewer.jupyter.org or when exported to html via the notebook’s File menu.


By default, the following options get passed into SlickGrid when show_grid is called. See the SlickGrid documentation for information about these options:

    'fullWidthRows': True,
    'syncColumnCellResize': True,
    'forceFitColumns': True,
    'rowHeight': 28,
    'enableColumnReorder': False,
    'enableTextSelectionOnCells': True,
    'editable': True,
    'autoEdit': False

See also

Permanently set global defaults for show_grid.
Permanently set individual SlickGrid options.