Skip to content

Instantly share code, notes, and snippets.

View frank-yifei-wang's full-sized avatar

Frank Wang frank-yifei-wang

View GitHub Profile
@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:
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""This module's docstring summary line.
This is a multi-line docstring. Paragraphs are separated with blank lines.
Lines conform to 79-column limit.
Module and packages names should be short, lower_case_with_underscores.
Notice that this in not PEP8-cheatsheet.py