import pandas as pd
import numpy as np
from tabulate import tabulate
df = pd.DataFrame(np.random.random((4,3)), columns=['A','B','C'])
print("foo")
return(tabulate(df, headers="keys", tablefmt="orgtbl"))
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\begin{tikzpicture}[ | |
mnode/.style={circle,draw=black,fill=black,inner sep=0pt,minimum size=2pt}, | |
node at every point/.style={% | |
decoration={% | |
show path construction, | |
lineto code={% | |
\coordinate (pos) at ($0.5*(\tikzinputsegmentlast)+0.5*(\tikzinputsegmentfirst)$); | |
\coordinate (direction) at ($(\tikzinputsegmentlast)-(\tikzinputsegmentfirst)$); | |
\gettikzxy{(direction)}{\dirx}{\diry} | |
\pgfmathsetmacro\rotationdir{atan(\diry/\dirx)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Debugger entered--Lisp error: (wrong-type-argument sequencep :grouptags) | |
mapconcat(identity ("PRIVATE" "{" "WORK" :grouptags "WORK@mittagseminar" "WORK@open_questions" "WORK@diss" "WORK@CV" "}" "{" "IT" :grouptags "IT@emacs" "IT@git" "IT@TeX" "}" "{" "PROG" :grouptags "PROG@mathematica" "PROG@cgal" "}" "}" "4freeTime" "bms_friday" "emacs" "interesting_questions" "mittagseminar" "Mittagsseminar" "NOTE" "private" "results" "work" "Yvinec" "Ziegler") " ") | |
(insert "#+TAGS: " (mapconcat (quote identity) tags " ") "\n") | |
(save-current-buffer (set-buffer temp-buffer) (while (setq entry (car (prog1 def-todo (setq def-todo (cdr def-todo))))) (insert "#+READONLY\n") (setq kwds (mapcar (function (lambda (x) (if (string-match "(" x) (substring x 0 ...) x))) (cdr entry))) (insert "#+TODO: " (mapconcat (quote identity) kwds " ") "\n") (setq dwds (member "|" kwds) twds (org-delete-all dwds kwds) todo-kwds (org-delete-all twds todo-kwds) done-kwds (org-delete-all dwds done-kwds))) (if (or todo-kwds done-kwds) (progn (in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% The Spiral of Roots (https://gist.github.com/drorata/8709182) | |
% | |
% Inspired by Felix Lindemann (http://www.texample.net/tikz/examples/rooty-helix/) | |
% | |
% Author: Dror Atariah, [email protected] | |
\documentclass[border=4pt]{standalone} | |
\usepackage{tikz} | |
\usetikzlibrary{calc} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sid=res['_scroll_id'] | |
IDs=[] | |
scroll_size=res['hits']['total'] | |
while (scroll_size > 0): | |
sys.stdout.write('.') | |
sys.stdout.flush() | |
try: | |
res=es.scroll(scroll_id=sid,scroll='1m') | |
IDs += res['hits']['hits'] | |
sid=res['_scroll_id'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Initialize the scroll | |
page = es.search( | |
index = 'yourIndex', | |
doc_type = 'yourType', | |
scroll = '2m', | |
search_type = 'scan', | |
size = 1000, | |
body = { | |
# Your query's body | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:d5b3e958f7624194296f7f343c6dd48ae49eb42a47ccc694f35bc575a2bd23d7" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:63382758aa4c42ca13e1a47f0deebe1617a89f35f5fcc00ce9f6b2e24efa2e9e" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Usage: python remove_output.py notebook.ipynb [ > without_output.ipynb ] | |
Modified from remove_output by: | |
damianavila (https://gist.github.com/damianavila/5305869) | |
""" | |
import sys | |
import io | |
import os | |
from IPython.nbformat import read, write |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyspark import SparkContext | |
sc = SparkContext(appName = "simple app") | |
sc._jsc.hadoopConfiguration().set("fs.s3n.awsAccessKeyId", "yourAccessKeyId") | |
sc._jsc.hadoopConfiguration().set("fs.s3n.awsSecretAccessKey", "yourSecretAccessKey") | |
text_file = sc.textFile("s3n://bucketName/filename.tar.gz") | |
counts = text_file.flatMap(lambda line: line.split(" ")) \ |
OlderNewer