MCPcopy Create free account
hub / github.com/ColdGrub1384/Pyto / encode

Function encode

site-packages/numpy/core/defchararray.py:568–600  ·  view source on GitHub ↗

Calls `str.encode` element-wise. The set of available codecs comes from the Python standard library, and may be extended at runtime. For more information, see the codecs module. Parameters ---------- a : array_like of str or unicode encoding : str, optional

(a, encoding=None, errors=None)

Source from the content-addressed store, hash-verified

566
567@array_function_dispatch(_code_dispatcher)
568def encode(a, encoding=None, errors=None):
569 """
570 Calls `str.encode` element-wise.
571
572 The set of available codecs comes from the Python standard library,
573 and may be extended at runtime. For more information, see the codecs
574 module.
575
576 Parameters
577 ----------
578 a : array_like of str or unicode
579
580 encoding : str, optional
581 The name of an encoding
582
583 errors : str, optional
584 Specifies how to handle encoding errors
585
586 Returns
587 -------
588 out : ndarray
589
590 See also
591 --------
592 str.encode
593
594 Notes
595 -----
596 The type of the result will depend on the encoding specified.
597
598 """
599 return _to_string_or_unicode_array(
600 _vec_string(a, object_, 'encode', _clean_args(encoding, errors)))
601
602
603def _endswith_dispatcher(a, suffix, start=None, end=None):

Callers 1

encodeMethod · 0.70

Calls 2

_clean_argsFunction · 0.85

Tested by

no test coverage detected