| [ Web Proxy ] |
| Viewing: https://numpy.org/doc/stable/reference/generated/../random/../generated/numpy.char.rjust.html | [Back] [Original] |
Return an array with the elements of a right-justified in a string of length width.
StringDType, bytes_, or str_ dtypeThe length of the resulting strings, unless width < str_len(a).
StringDType, bytes_, or str_ dtypeOptional padding character to use (default is space).
Output array of StringDType, bytes_ or str_ dtype,
depending on input types
See also
Notes
While it is possible for a and fillchar to have different dtypes,
passing a non-ASCII character in fillchar when a is of dtype S
is not allowed, and a ValueError is raised.
Examples
>>> import numpy as np
>>> a = np.array(['aAaAaA', ' aA ', 'abBABba'])
>>> np.strings.rjust(a, width=3)
array(['aAaAaA', ' aA ', 'abBABba'], dtype='<U7')
>>> np.strings.rjust(a, width=9)
array([' aAaAaA', ' aA ', ' abBABba'], dtype='<U9')
| Web Proxy Viewer | New URL | Original Page |