bronx.datagrip.varbc

Utility class to read VarBC files.

The VarbcFile should be used to read VarBC files (see its documentation below).

Classes

class bronx.datagrip.varbc.VarbcEntry[source]

Bases: object

One entry of a VarBC file.

The comparison operator == is available between objects of this class.

No arguments have to be provided at creation time.

ix

The entry identifier.

key

The entry key.

ndata

Number of data.

npred

Number of predictors.

params

Coefficients NumPy array.

predcs

Predictors NumPy array.

type

The observation type.

valid()[source]

Check if all the mandatory fields are properly set up.

class bronx.datagrip.varbc.VarbcFile(asciidatas)[source]

Bases: Mapping

Class to handle a full VarBC file.

It provides then two simple methods to access to elements ObsVarbcEntry, one with ix (getix()), the other with varbc ‘key’ (getkey()).

It also behaves like a Mapping since the __getitem__(), __iter__(), keys(), values() and items() methods are defined. With all of these methods, the values are returned in the same order than originaly read in thh VarBC file.

Parameters:

asciidatas – Any iterable over lines from a VarBC file.

getix(ix)[source]

Gives the ix th entry of the VarBC file

Return type:

VarbcEntry

getkey(key)[source]

Returns a VarBC entry given its key

Return type:

VarbcEntry

Example:

myobj.getkey('4 3 7')

items()[source]

Iterate over all the (key, entry) pairs available in the VarBC file.

keys()[source]

Iterate over all the keys available in the VarBC file.

property metadata

The metadata associated to the varbc file.

Return type:

bronx.datagrip.varbcheaders.VarbcHeadersFile

values()[source]

Iterate over all the ObsVarbcEntry objects read from file.