Use numpy.tile
:
>>> tile(array([1,2,3]), (3, 1))
array([[1, 2, 3],
[1, 2, 3],
[1, 2, 3]])
or for repeating columns:
>>> tile(array([[1,2,3]]).transpose(), (1, 3))
array([[1, 1, 1],
[2, 2, 2],
[3, 3, 3]])
More Related Contents:
- Understanding tensordot
- Link ATLAS/MKL to an installed Numpy
- Fitting a line in 3D
- numpy arbitrary precision linear algebra
- Why does numpy.linalg.solve() offer more precise matrix inversions than numpy.linalg.inv()?
- Equivalent of `polyfit` for a 2D polynomial in Python
- How to find linearly independent rows from a matrix
- Efficient dot products of large memory-mapped arrays
- How do I get indices of N maximum values in a NumPy array?
- How to convert a PIL Image into a numpy array?
- How to apply a disc shaped mask to a NumPy array?
- python numpy/scipy curve fitting
- Multiple linear regression in Python
- Numpy – create matrix with rows of vector
- Using Numpy Vectorize on Functions that Return Vectors
- Numpy individual element access slower than for lists
- How to turn a video into numpy array?
- AttributeError: ‘numpy.float64’ object has no attribute ‘log10’
- How to get stable results with TensorFlow, setting random seed
- Why does numpy std() give a different result to matlab std()?
- Installing lapack for numpy
- Adding colors to a 3d quiver plot in matplotlib
- One Hot Encoding using numpy [duplicate]
- Is there a numpy/scipy dot product, calculating only the diagonal entries of the result?
- numpy – evaluate function on a grid of points
- How can I draw lines into numpy arrays?
- Get the indices of N highest values in an ndarray
- Interweaving two NumPy arrays efficiently
- How to convert a 3d numpy array to 2d
- Numpy.dtype has the wrong size, try recompiling