import os.path as path
filename = path.join(mkdtemp(), 'tempfile.dat')
A = NP.memmap(fpath, dtype='float32', mode='w+', shape=(150, 5))
A[:] = somedata[:]
rpy2: Converting a data.frame to a numpy array