Skip to content

Instantly share code, notes, and snippets.

@frank-yifei-wang
frank-yifei-wang / view.py
Created August 29, 2019 16:55
View Pandas DataFrame in a pop-up window/tab rendered with JavaScript and CSS code. Similar to RStudio's 'View' function.
from IPython.display import HTML
def view(df=None, title: str = 'DataFrame', fs: int = 12):
"""View Pandas DataFrame in a pop-up window/tab rendered with JavaScript and CSS code. Similar to RStudio's 'View' function.
Args:
df: DataFrame to view
title: title of the pop-up (to help distinguish if there are multiple pop-ups)
fs: font size in pixels
Examples: