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

Method view

zipline/lib/labelarray.py:507–520  ·  view source on GitHub ↗
(self, dtype=_NotPassed, type=_NotPassed)

Source from the content-addressed store, hash-verified

505 del _equality_check
506
507 def view(self, dtype=_NotPassed, type=_NotPassed):
508 if type is _NotPassed and dtype not in (_NotPassed, self.dtype):
509 raise TypeError("Can't view LabelArray as another dtype.")
510
511 # The text signature on ndarray.view makes it look like the default
512 # values for dtype and type are `None`, but passing None explicitly has
513 # different semantics than not passing an arg at all, so we reconstruct
514 # the kwargs dict here to simulate the args not being passed at all.
515 kwargs = {}
516 if dtype is not _NotPassed:
517 kwargs['dtype'] = dtype
518 if type is not _NotPassed:
519 kwargs['type'] = type
520 return super(LabelArray, self).view(**kwargs)
521
522 def astype(self,
523 dtype,

Callers 15

as_int_arrayMethod · 0.95
astypeMethod · 0.95
numpy_utils.pyFile · 0.80
isnatFunction · 0.80
compare_datetime_arraysFunction · 0.80
_dt_to_epoch_nsFunction · 0.80
__getitem__Method · 0.80
_normalize_arrayFunction · 0.80
dataMethod · 0.80
to_ctableMethod · 0.80
start_of_simulationMethod · 0.80

Calls

no outgoing calls

Tested by 4

test_differing_nansMethod · 0.64