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

Function _get_num_chars

numpy/core/defchararray.py:89–97  ·  view source on GitHub ↗

Helper function that returns the number of characters per field in a string or unicode array. This is to abstract out the fact that for a unicode array this is itemsize / 4.

(a)

Source from the content-addressed store, hash-verified

87 return newargs
88
89def _get_num_chars(a):
90 """
91 Helper function that returns the number of characters per field in
92 a string or unicode array. This is to abstract out the fact that
93 for a unicode array this is itemsize / 4.
94 """
95 if issubclass(a.dtype.type, str_):
96 return a.itemsize // 4
97 return a.itemsize
98
99
100def _binary_op_dispatcher(x1, x2):

Callers 3

_to_bytes_or_str_arrayFunction · 0.85
addFunction · 0.85
multiplyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected