MCPcopy Create free account
hub / github.com/numpy/numpy / __getitem__

Method __getitem__

numpy/core/defchararray.py:2103–2113  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

2101 raise ValueError("Can only create a chararray from string data.")
2102
2103 def __getitem__(self, obj):
2104 val = ndarray.__getitem__(self, obj)
2105
2106 if isinstance(val, character):
2107 temp = val.rstrip()
2108 if len(temp) == 0:
2109 val = ''
2110 else:
2111 val = temp
2112
2113 return val
2114
2115 # IMPLEMENTATION NOTE: Most of the methods of this class are
2116 # direct delegations to the free functions in this module.

Callers

nothing calls this directly

Calls 1

rstripMethod · 0.80

Tested by

no test coverage detected