Python – how to resize an array and duplicate the elements
Python – how to resize an array and duplicate the elements Question: I’ve got an array with data like this a = [[1,2,3],[4,5,6],[7,8,9]] and I want to change it to b = [[1,1,2,2,3,3],[1,1,2,2,3,3],[4,4,5,5,6,6],[4,4,5,5,6,6],[7,7,8,8,9,9],[7,7,8,8,9,9]] I’ve tried to use numpy.resize() function but after resizing, it gives [[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3,4]]. I can use a for loop to put the numbers …