Quantopian's Qgrid is a scrollable grid widget that can be used to edit sort and filter DataFrames in Jupyter notebooks. It is now available for use in the Quantopian research environment. Created as an open-source project by Quantopian's engineering team, the library has reached over 1K stars on GitHub and is used by many other organizations. Now you can use it too, right here on Quantopian.
You can think of Qgrid as an interactive alternative to the static html table that you normally see when you view a DataFrame in a notebook. By allowing you to explore your DataFrames with a simple point-and-click interface, Qgrid makes it easy for you to accomplish common data science tasks, such as:
- Locating a particular cell in your DataFrame (without having to write any code or ctrl+F searching on the page)
- Spot checking your data for correctness
- Identifying the date range for which a particular data set is available
To give you an idea of what qgrid looks like in action, the following images show a DataFrame that was returned from Quantopian's Pipeline API, rendered first as a static html table, then again using qgrid.
Pipeline data, rendered without qgrid:
The same data, rendered with qgrid:
Using Qgrid in the research environment
To use qgrid in a notebook, you should import the qgrid
module and call show_grid
, like so:
import qgrid
qgrid.show_grid(df)
The best way to try out qgrid is to click the "Clone Notebook" button below to clone the attached notebook. That notebook will guide you through a few quick examples to help you get familiar with the qgrid API.