Skip to content

Render DataFrames as real tables (itables) — starting with the stale PNG in groupby.md #282

Description

@mmcky

lectures/pandas/groupby.md:565 displays a table result as a static PNG_static/groupby_cohort_analysis_exercise_output.png — which has been out of date since it was reported in #214 on 2022-11-13. That issue is still open, so a reader-visible defect in a core pandas lecture has stood for over three and a half years.

The underlying want — showing a DataFrame as something better than a truncated repr or a screenshot — is real, and it has a cheap answer.

Proposal: itables

itables renders a pandas DataFrame as a sortable, searchable HTML table. It is a good fit for this specific problem for reasons that were verified by running it, not read off the marketing:

Property Detail
Licence MIT — in line with the rest of the stack (pandas, numpy are BSD-3)
Dependencies Zero runtime dependencies
Static builds show(df) survives nbconvert into fully self-contained static HTML — 276 KB for a representative table
Colab Works. This matters because getting_started.md recommends Colab as the free option and every lecture page carries a Colab button
Maintenance 2.9.1 released 2026-07-22

The static-HTML property is the important one. It means the table is genuinely interactive for a reader on the published site, with no kernel and no server — as opposed to a screenshot, which is what is there now.

Suggested scope

Start with the one defect: replace the stale PNG at groupby.md:565 with a real rendered table, which closes #214. If that reads well, the same treatment is worth considering wherever a lecture currently shows a truncated DataFrame repr and the shape of the data is the point.

Context

This came out of evaluating Mito (QuantEcon/meta#59, closed as declined). Mito was the wrong vehicle — it only renders inside a JupyterLab application with its extension installed, raises an exception in Colab, and in a static build paints a full spreadsheet that silently ignores every interaction, at 2.36 MB per cell. But the want it was pointing at was sound, and itables clears both constraints Mito fails.

Unrelated note, since it is adjacent

lectures/introduction/local_install.md lines 100–104 and 122–126 instruct readers to run jupyter labextension install ... followed by jupyter lab build. That source-build path was removed in JupyterLab 4, so those instructions no longer work. Worth fixing or removing while someone is in this area.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions