estimator.cost.Cost.reorder#

Cost.reorder(*args)[source]#

Return a new ordered dict from the key:value pairs in dictinonary but reordered such that the keys given to this function come first.

Parameters

args – keys which should come first (in order)

EXAMPLE:

>>> from estimator.cost import Cost
>>> d = Cost(a=1,b=2,c=3); d
a: 1, b: 2, c: 3

>>> d.reorder("b","c","a")
b: 2, c: 3, a: 1