Giter VIP home page Giter VIP logo

dataframe2img's Introduction

dataframe2img

Binder

Makes images of stylized dataframes so that when Jupyter notebooks are reopened, the stylized view is represented. Importantly, it includes tips that also enable it to be done without generating giant file sizes as well.

Click on a launch binder badge on this page to launch a session where everything needed for this process is set up and the steps in the process are demonstrated.

Pandas dataframe styling is a great feature for visualizing tabular data right in a notebook; however, it is annoying that it gets removed from rendering when you reopen the notebook. (At least every place I have seen so far for apllied cell and text coloring while style.format settings such as style.format("{:.2%}" to show floats as percents with two-decimals, seem to survive. Always to be the case for cell and text coloring?) I wanted a way to have at least the information visible when I reload. So an image would at least be viewable, albeit not as interactive.

STEPS:
Pandas dataframe --> Pandas dataframe with conditional stylized cells ---> Pandas dataframe converted to HTML --> image file --> image viewable when notebook reopened.


Attribution

This builds on the approach from Shovalt here, with some advanced styling following Andy Lane's post.

Addressing the default image size and quality of output was worked out with advice found here (thanks especially to landonwilkins) and here (thanks especially to jarrekk).


Click on a launch binder badge on this page to launch a session where everything needed for this process is set up and the steps are demonstrated.

Binder

dataframe2img's People

Contributors

fomightez avatar

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.