Skip to content

Instantly share code, notes, and snippets.

View pemn's full-sized avatar

Paulo Ernesto pemn

View GitHub Profile
@pemn
pemn / fitarray.py
Last active November 17, 2016 17:09
Multi dimensional array with automatic expansion
#!python
# Multi dimensional array with automatic expansion
# compatible with masked arrays
import numpy as np
# convert a flat index to a dimension indexes
# 7 => (1,1,1)
def static_index_to_key(itemsize, strides, index):
@pemn
pemn / ipc.py
Last active February 1, 2020 11:31 — forked from dankrause/ipc.py
Simple socket IPC in python (updated for python3)
import socketserver
import socket
import struct
import json
import collections
class IPCError(Exception):
pass