shithub: aubio

ref: 6f0ef4dd26b5c33cb378489b2279bd61ea4f2720
dir: /python/tests/utils.py/

View raw version
#! /usr/bin/env python

def array_from_text_file(filename, dtype = 'float'):
  import os.path
  from numpy import array
  filename = os.path.join(os.path.dirname(__file__), filename)
  return array([line.split() for line in open(filename).readlines()], 
      dtype = dtype)