Observation List

Getting an observation list

Do not construct an Observation List directly. Instead, use this method on a metric.

ocdsmetricsanalysis.library.Metric.get_observation_list(self)

Returns a new ObservationList object that you can use for filtered querying for observations.

Class reference

class ocdsmetricsanalysis.library.ObservationList(metric: Metric)

A class to get list of observations from a metric. It has methods to set query filters, and then methods to get the data.

Do not construct directly; instead call get_observation_list on a Metric to get an observation list.

filter_by_dimension(dimension_key: str, dimension_value: str)

Filter by dimension - this key must match this value exactly.

filter_by_dimension_not_set(dimension_key: str)

Filter by dimension - this key must not exist on the observation.

get_data() list

Returns a list of Observations.

Observations will match the filters set on this observation list. (Just don’t set any filters to get all observations.)

get_data_by_dimension(dimension_key: str) dict

Returns Observations grouped by the value of a dimension key.

Observations will match the filters set on this observation list. (Just don’t set any filters to get all observations.)

Returns a dict. The key is the value of the dimension, and the value is a list of all observations with that dimension value.