Package recsql :: Module csv_table :: Class Table2array
[hide private]
[frames] | no frames]

Class Table2array

source code

object --+
         |
        Table2array

Read a csv file and provide conversion to a :class:`numpy.recarray`.

* Depending on the arguments, autoconversion of values can take
  place. See :class:`recsql.convert.Autoconverter` for details.

* Table column headers are always read from the first row of the file.

* Empty rows are discarded.     

Instance Methods [hide private]
 
__init__(self, filename=None, tablename="CSV", encoding="utf-8", **kwargs)
:Arguments: *filename* CSV file (encoded with *encoding*) *name* name of the table *autoconvert* EXPERIMENTAL.
source code
 
recarray(self)
Returns data as :class:`numpy.recarray`.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, filename=None, tablename="CSV", encoding="utf-8", **kwargs)
(Constructor)

source code 

:Arguments:
   *filename*
      CSV file (encoded with *encoding*)
   *name*
      name of the table
   *autoconvert*
      EXPERIMENTAL. ``True``: replace certain values
      with special python values (see :class:`convert.Autoconverter`) and possibly 
      split values into lists (see *sep*).
      ``False``: leave everything as it is (numbers as numbers and strings 
      as strings).
   *mode*
      mode of the :class:`~convert.Autoconverter`

Overrides: object.__init__