Skip to content

Instantly share code, notes, and snippets.

View jupyterlab-d3.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
jkw552403 /
Created March 25, 2019 08:33
click share options #python #click
def common_params(func):
def wrapper(*args, **kwargs):
return func(*args, **kwargs)
return wrapper
jkw552403 / interactivity
Created November 7, 2018 05:41
[Notebook Interactivity] Show all outputs in a notebook cell #Python #Notebook
View interactivity
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
jkw552403 / wordcloud
Created August 17, 2018 03:03
wordcloud #Python #viz
View wordcloud
wc = WordCloud(background_color="white", max_words=1000,
wc.generate(texts with space)
jkw552403 / subplot
Created August 17, 2018 03:02
View subplot
fig, ax = plt.subplots(nrows, ncols, figsize=(8, 8))
jkw552403 / figure
Last active August 17, 2018 03:03
Single plt plot #viz
View figure
plt.figure(figsize=(8, 8))
jkw552403 /
Last active June 6, 2018 03:37
python main script with click
import click
def main():
if __name__ == "__main__":
View gist:793837d8f78e4e5d8ce88794dd47fe99
import re
sent = 'a b c b c c A B C B C C'
match ='\w+', sent)
while match:
word =
sent, count = re.subn(word, '', sent, flags=re.I)
match ='\w+', sent)
print(word, count)
import sys
import unicodedata
table = {c: ' ' for c in range(sys.maxunicode)
if unicodedata.category(chr(c)).startswith('P')}
def remove_puntuation(s):
return s.translate(table)
# -*- coding: utf-8 -*-
import sys
import unicodedata
table = {c: u' ' for c in range(sys.maxunicode)
if unicodedata.category(unichr(c)).startswith('P')}
def remove_punctuation(s):
return s.translate(table)