<commit_before>String operations
=================

.. currentmodule:: numpy.char

.. module:: numpy.char

The `numpy.char` module provides a set of vectorized string
operations for arrays of type `numpy.str_` or `numpy.bytes_`.
All of them are based on the string methods in the Python standard library.

String operations
-----------------

.. autosummary::
   :toctree: generated/

   add
   multiply
   mod
   capitalize
   center
   decode
   encode
   expandtabs
   join
   ljust
   lower<commit_msg>DOC: added example in char (#22500)<commit_after>String operations
=================

.. currentmodule:: numpy.char

.. module:: numpy.char

The `numpy.char` module provides a set of vectorized string
operations for arrays of type `numpy.str_` or `numpy.bytes_`. For example

      >>> np.char.capitalize(["python", "numpy"])
      array(['Python', 'Numpy'], dtype='<U6')
      >>> np.char.add(["num", "doc"], ["py", "umentation"])
      array(['numpy', 'documentation'], dtype='<U13')

The methods in this module are based on the methods in :py:mod:`String`

String operations
-----------------

.. autosummary::
   :toctree: generated/

   add
   multiply
   mod
   capitalize
   center
   decode
   encode
   expandtabs
   join
   ljust
   lower
{'fraction_non_alphanumeric': 0.16108452950558214, 'fraction_numerical': 0.006379585326953748, 'mean_word_length': 3.0614886731391584, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '807248', 'n_tokens_mistral': 387, 'n_tokens_neox': 371, 'n_words': 122}