Package gmisclib :: Module fiatio :: Class merged_writer
[frames] | no frames]

Class merged_writer

source code


Assumes that the data will be read with read_merged(), so that header values will supply default values for each column.

Instance Methods
 
__init__(self, fd, sep='\t', blank='%na')
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
header(self, k, v)
Add a single key=value line to the header of the data file.
source code
 
datum(self, data_item)
Assumes that the data will be read with read_merged(), so that header values will supply default values for each column.
source code
 
add_cols(self, colnames) (Inherited from gmisclib.fiatio.writer) source code
 
append(self, d) (Inherited from gmisclib.gpk_writer.writer) source code
 
close(self) (Inherited from gmisclib.gpk_writer.writer) source code
 
comment(self, comment)
Add a comment to the data file. (Inherited from gmisclib.fiatio.writer)
source code
 
comments(self, comments)
Add comments to the data file. (Inherited from gmisclib.gpk_writer.writer)
source code
 
data(self, dataset)
Write a series of lines to the output file. (Inherited from gmisclib.gpk_writer.writer)
source code
 
datavec(self, vector, numeric=False)
This assumes that you've already called add_cols() to set the column names. (Inherited from gmisclib.fiatio.writer)
source code
 
extend(self, d) (Inherited from gmisclib.gpk_writer.writer) source code
 
flush(self) (Inherited from gmisclib.gpk_writer.writer) source code
 
headers(self, h) (Inherited from gmisclib.gpk_writer.writer) source code

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

Properties

Inherited from object: __class__

Method Details

__init__(self, fd, sep='\t', blank='%na')
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • fd - where to write the data
  • sep - what separates columns?
  • blank - what marks a spot where there isn't data?
Overrides: object.__init__
(inherited documentation)

header(self, k, v)

source code 

Add a single key=value line to the header of the data file.

Parameters:
  • k - key
  • v - value
Overrides: gpk_writer.writer.header

datum(self, data_item)

source code 

Assumes that the data will be read with read_merged(), so that header values will supply default values for each column. This writes a line in the fiat file, but first it deletes any values that alread exist as a header item of the same name.

Parameters:
  • data_item - a dictionary of key=value pairs.
Overrides: gpk_writer.writer.datum