I've been working on translating some NumPY examples into PDL.  There
has been some positive reinforcement on Perl Monks as can be seen
here:

https://www.perlmonks.org/?node_id=1233413

I am stuck on the following NumPy example:

Q. Create the following pattern without hardcoding. Use only numpy
functions and the below input array a.

Input:
a = np.array([1,2,3])`

Desired Output:
array([1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3])

Solution
np.r_[np.repeat(a, 3), np.tile(a, 3)]
#> array([1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3])

Does PDL have something equivalent to NumPy's "tile" function?  I've
looked through the docs and do not see anything obvious to solve the
problem.


_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general

Reply via email to