danijar / handout

Turn Python scripts into handouts with Markdown and figures

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pandas Dataframe Display Support

Phutoast opened this issue · comments

Hi, it would be great to have a handout that could generate/display a Dataframe table. Might be something like doc.add_dataframe(df)

I thought of tables too - might be a good feature!

Would doc.add_dataframe(df) need to do anything beyond doc.add_html(df.to_html())?

Maybe when the table is very big, we might only show some parts of the start of the table and some parts at the end of the table (similar to jupyer notebook, when showing a big dataframe).

This might be somewhat achieved using max_rows or max_cols. More of like how we display the table itself.

But generally, doc.add_html(df.to_html()) is a good idea for a small table

Sounds good, I'll close this for now and add the documentation tag. We should include your one-liner in the user guide. If anybody has an actual need for more interactivity, feel free to open a new issue and we can discuss.