MCPcopy
hub / github.com/quantopian/zipline / set_scalar

Method set_scalar

zipline/lib/labelarray.py:405–427  ·  view source on GitHub ↗

Set scalar value into the array. Parameters ---------- indexer : any The indexer to set the value at. value : str The value to assign at the given locations. Raises ------ ValueError Raised when ``

(self, indexer, value)

Source from the content-addressed store, hash-verified

403 )
404
405 def set_scalar(self, indexer, value):
406 """
407 Set scalar value into the array.
408
409 Parameters
410 ----------
411 indexer : any
412 The indexer to set the value at.
413 value : str
414 The value to assign at the given locations.
415
416 Raises
417 ------
418 ValueError
419 Raised when ``value`` is not a value element of this this label
420 array.
421 """
422 try:
423 value_code = self.reverse_categories[value]
424 except KeyError:
425 raise ValueError("%r is not in LabelArray categories." % value)
426
427 self.as_int_array()[indexer] = value_code
428
429 def __setslice__(self, i, j, sequence):
430 """

Callers

nothing calls this directly

Calls 1

as_int_arrayMethod · 0.95

Tested by

no test coverage detected