Skip to content

Instantly share code, notes, and snippets.

View andrewfowlie's full-sized avatar

Andrew Fowlie andrewfowlie

View GitHub Profile
@andrewfowlie
andrewfowlie / libload.py
Created July 4, 2017 23:45
Load functions into Python from a C++ library automagically
"""
Load functions from a dynmaic library via the header file
=========================================================
"""
import ctypes
import numpy as np
import json
import sys
from collections import OrderedDict as odict
@andrewfowlie
andrewfowlie / h5_txt.py
Last active November 16, 2022 16:24
Convert h5 -> txt format
"""
Make a numpy array
>>> np_array = np.random.random((30, 30))
Write it in h5 format
>>> h5_name = 'np_array.h5'
>>> write_dh5_np(h5_name, np_array)