ENH: write to csv
Merge branch 'master' into detect