chevron_left
Char
Method addMethod capitalizeMethod centerMethod countMethod endswithMethod equalMethod expandtabsMethod findMethod greaterMethod greater_equalMethod indexMethod isalnumMethod isalphaMethod isdecimalMethod isdigitMethod isnumericMethod isupperMethod joinMethod lessMethod less_equalMethod ljustMethod lowerMethod multiplyMethod not_equalMethod rfindMethod rjustMethod rstripMethod splitMethod splitlinesMethod startswithMethod upperMethod zfill
0
0
0
new
NumPy char | multiply method
Programming
chevron_rightPython
chevron_rightNumPy
chevron_rightDocumentation
chevron_rightChar
schedule Mar 9, 2022
Last updated Python●NumPy
Tags tocTable of Contents
expand_more Numpy's multiply(~)
method takes in an array of strings as well as an array of integers, and each string is repeated as specified.
Parameters
1. x1
| array-like
of string
The strings you want repeated.
2. x2
| array-like
of int
The numbers of repeats of each string.
Examples
np.char.multiply(["a","b"], [2,3])
array(['aa', 'bbb'], dtype='<U3')
Published by Isshin Inada
Edited by 0 others
Did you find this page useful?
Ask a question or leave a feedback...