API Reference for Enthought Tool Suite 3.2.0

Sniff a CSV file and determine some of it's properties.

The properties determined here allow an CSV of unknown format to be read by numpy.loadtxt, i.e. the methods and attributes are suitable to determine required keyword arguments for numpy.loadtxt

Example:

s = Sniff('mydata.csv')
print repr(s.delimiter())     # ','
print s.skiprows()            # 2
a = s.loadtxt()               # a is now the array

from numpy import loadtxt     # make sure it's numpy 1.1.0 or higher
b = loadtxt('mydata.csv', **s.kwds())

Method summary

Methods

© Copyright 2002-2009 Enthought, Inc.