Skip to content

Instantly share code, notes, and snippets.

@salticus
salticus / load_multiple_files_in_numpy.md
Last active April 19, 2024 15:10
Load multiple files using numpy.loadtxt

Load multiple files using numpy.loadtxt

A functional approach

#!/usr/bin/env python
"""
The examples below show how to load multiple files via numpy loadtext.

Sorting the files may or may not be necessary depending on your problem.
@salticus
salticus / filter_gnucash_transactions.py
Created February 16, 2017 06:56
Destructive hack to delete all transactions in a GNUCash file except those in the target year.
#!/usr/bin/env python
"""
Create gnucash file with transactions only in the target year.
Delete all others.
Requires a gnucash file in sqlite3 format.
To convert an XML GNUCash file to SQLite3,
"Save As -> Select sqlite3 as the format"
If on Ubuntu the only "Save As" option is XML, try
#!/bin/bash
# https://gist.github.com/salticus/9519167
# License GPLv3
# Create a svg representation of a django template inheritance tree
# use web browser, eog (if you're on ubuntu) or whatever to view
TEMPLATE_DIR=templates
DOT_DIR="$( pwd )"