Skip to content

Instantly share code, notes, and snippets.

View gatagat's full-sized avatar

Tomas Kazmar gatagat

View GitHub Profile
@gatagat
gatagat / create_python_kernel-ii2.sh
Created November 28, 2018 12:45
Jupyterhub on II2
#!/bin/bash
MODULES=(
ipython/.5.3.0-foss-2017a-python-2.7.13 \
ipywidgets/7.2.1-foss-2017a-python-2.7.13 \
matplotlib/2.2.2-foss-2017a-python-2.7.13 \
pillow/5.1.0-foss-2017a-python-2.7.13 \
av/6.0.0-foss-2017a-python-2.7.13 \
scipy/1.0.1-foss-2017a-python-2.7.13 \
scikit-learn/0.19.1-foss-2017a-python-2.7.13 \
@gatagat
gatagat / lapmod.py
Last active January 8, 2019 16:10
Using lapmod with non-square matrices
def prepare_sparse_cost(shape, cc, ii, jj, cost_limit):
'''
Transform the given sparse matrix extending it to a square sparse matrix.
Parameters
==========
shape: tuple
- cost matrix shape
(cc, ii, jj): tuple of floats, ints, ints)
- cost matrix in COO format, see [1].