Package psychopy :: Module data :: Class DataHandler
[frames] | no frames]

Class DataHandler

source code


For handling data (used by TrialHandler, principally, rather than by users directly)

Numeric data are stored as numpy masked arrays where the mask is set True for missing entries. When any non-numeric data (string, list or array) get inserted using DataHandler.add(val) the array is converted to a standard (not masked) numpy array with dtype='O' and where missing entries have value="--"

Attributes:
Instance Methods
new empty dictionary

__init__(self, dataTypes=None, trials=None, dataShape=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
addDataType(self, names, shape=None)
Add a new key to the data dictionary of particular shape if specified (otherwise the shape of the trial matrix in the trial handler.
source code
 
add(self, thisType, value, position=None)
Add data to an existing data type (and add a new one if necess)
source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __hash__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties

Inherited from object: __class__

Method Details

__init__(self, dataTypes=None, trials=None, dataShape=None)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Returns:
new empty dictionary

Overrides: object.__init__
(inherited documentation)

addDataType(self, names, shape=None)

source code 
Add a new key to the data dictionary of particular shape if specified (otherwise the shape of the trial matrix in the trial handler. Data are initialised to be zero everywhere. Not needed by user: appropriate types will be added during initialisation and as each xtra type is needed.