Using numpy to build an array of all combinations of two arrays
Cartesian product function by Stackoverflow user, pv
.
See Answer here.
%% This part goes in preamble | |
\newcommand{\dummyfig}[1]{ | |
\centering | |
\fbox{ | |
\begin{minipage}[c][0.33\textheight][c]{0.5\textwidth} | |
\centering{#1} | |
\end{minipage} | |
} | |
} |
Using numpy to build an array of all combinations of two arrays
Cartesian product function by Stackoverflow user, pv
.
See Answer here.
#include <boost/program_options.hpp> | |
#include <sstream> | |
#include <fstream> | |
#include <iterator> | |
#include <algorithm> | |
namespace po = boost::program_options; | |
class Options | |
{ |
# coding: utf-8 | |
# command example: | |
# $ spark-submit spark_log_extract.py \ | |
# --name test \ | |
# --notblankkeys dn,stm,ev_ac,pg_url \ | |
# --filterregex ".*(=ac_pl\`|=ac_dl\`).*" \ | |
# --usegzip \ | |
# /path/to/source \ | |
# /path/to/atom \ |
import os | |
directory = '/home/kenny/gist' | |
if not os.path.exists(directory): | |
os.makedirs(directory) | |
import numpy as np | |
import matplotlib.patches as mpatches | |
import networkx as nx | |
from matplotlib.patches import FancyArrowPatch as ArrowPath | |
from matplotlib.font_manager import FontProperties | |
def draw_curved_edges(edges, pos, ax, mu=0.05, edge_color="black", edge_width=1.0, alpha=1.0, arrow_scale=20.0, loopsize=0): | |
""" | |
# -*- coding: utf-8 -*- | |
""" | |
Wrapper around dreadnaut that computes the orbits of a graph. | |
NOTE: Must have installed `dreandaut`. The location of the binary can be passed | |
as an argument to `compute_automorphisms`. | |
Author: Jean-Gabriel Young <info@jgyoung.ca> | |
""" | |
import subprocess |