databroker.Header.table

Header.table(self, stream_name='primary', fields=None, fill=False, timezone=None, convert_times=True, localize_times=True)[source]

Load the data from one event stream as a table (pandas.DataFrame).

Parameters
stream_namestr, optional

Get events from only “event stream” with this name.

Default is ‘primary’

fieldsList[str], optional

whitelist of field names of interest; if None, all are returned

Default is None

fillbool or Iterable[str], optional

Which fields to fill. If True, fill all possible fields.

Each event will have the data filled for the intersection of it’s external keys and the fields requested filled.

Default is False

handler_registrydict, optional

mapping filestore specs (strings) to handlers (callable classes)

convert_timesbool, optional

Whether to convert times from float (seconds since 1970) to numpy datetime64, using pandas. True by default.

timezonestr, optional

e.g., ‘US/Eastern’; if None, use metadatastore configuration in self.mds.config[‘timezone’]

localize_timesbool, optional

If the times should be localized to the ‘local’ time zone. If True (the default) the time stamps are converted to the localtime zone (as configure in mds).

This is problematic for several reasons:

  • apparent gaps or duplicate times around DST transitions

  • incompatibility with every other time stamp (which is in UTC)

however, this makes the dataframe repr look nicer

This implies convert_times.

Defaults to True to preserve back-compatibility.

Returns
tablepandas.DataFrame

Examples

Load the ‘primary’ data stream from the most recent run into a table.

>>> h = db[-1]
>>> h.table()

This is equivalent. (The default stream_name is ‘primary’.)

>>> h.table(stream_name='primary')
                            time intensity
0  2017-07-16 12:12:37.239582345       102
1  2017-07-16 12:12:39.958385283       103

Load the ‘baseline’ data stream.

>>> h.table(stream_name='baseline')
                            time temperature
0  2017-07-16 12:12:35.128515999         273
1  2017-07-16 12:12:40.128515999         274