3 ms·
Replicate looks like numpy's repeat. For example np.repeat(list("abcd"), [2,1,0,2]) is equivalent to the first example in the link.
by henrydark 4y ago
Replicate looks like numpy's repeat. For example
np.repeat(list("abcd"), [2,1,0,2])
is equivalent to the first example in the link.
- mlochbaum 4y agoAh, thank you! I'd tried to find this for implementing BQN in NumPy (never finished) and didn't. Maybe I thought it only worked with a scalar for the number of repetitions.