Quantcast
Channel: Active questions tagged row - Stack Overflow
Viewing all articles
Browse latest Browse all 447

How to duplicate each row of a matrix N times Numpy

$
0
0

I have a matrix with these dimensions (150,2) and I want to duplicate each row N times. I show what I mean with an example.

Input:

a = [[2, 3], [5, 6], [7, 9]]

suppose N= 3, I want this output:

[[2 3] [2 3] [2 3] [5 6] [5 6] [5 6] [7 9] [7 9] [7 9]]

Thank you.


Viewing all articles
Browse latest Browse all 447

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>