pysal

This Page

Tables — DataTable Extension for PySAL’s FileIO System

New in version 1.0.

class pysal.core.Tables.DataTable(*args, **kwargs)

DataTable provides additional functionality to FileIO for data table file tables FileIO Handlers the provide data tables should subclass this instead of FileIO

Methods

by_col
by_row
cast
check
close
flush
get
getType
next
open
read
seek
tell
truncate
write
class by_col(parent)
class DataTable.by_row(parent)
DataTable.cast(key, typ)
cast key as typ
classmethod DataTable.check()
Prints the contents of the registry
DataTable.close()
subclasses should clean themselves up and then call this method
DataTable.flush()
DataTable.get(n)
Seeks the file to n and returns n If .ids is set n should be an id, else, n should be an offset
static DataTable.getType(dataPath)
Parse the dataPath and return the data type
DataTable.ids
DataTable.next()
A FileIO object is its own iterator, see StringIO
classmethod DataTable.open(*args, **kwargs)
Alias for FileIO()
DataTable.rIds
DataTable.read(n=-1)
Read at most n objects, less if read hits EOF if size is negative or omitted read all objects until EOF returns None if EOF is reached before any objects.
DataTable.seek(n)
Seek the FileObj to the beginning of the n’th record, if ids are set, seeks to the beginning of the record at id, n
DataTable.tell()
Return id (or offset) of next object
DataTable.truncate(size=None)
Should be implemented by subclasses and redefine this doc string
DataTable.write(obj)
Must be implemented by subclasses that support ‘w’ subclasses should increment .pos subclasses should also check if obj is an instance of type(list) and redefine this doc string