Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

copy along additional dimension numpy

a = np.array([[1,2],[1,2]])
b = np.repeat(a[:, :, np.newaxis], 3, axis=2)
print(b[:, :, 0])
# [[1 2]
#  [1 2]]

print(b[:, :, 1])
# [[1 2]
#  [1 2]]

print(b[:, :, 2])
# [[1 2]
#  [1 2]]
Comment

PREVIOUS NEXT
Code Example
Python :: streamlit format_func example 
Python :: Print characters from a string that are present at an even index number 
Python :: plot the distribution of value_counts() python 
Python :: selenium select svg python3 
Python :: flask get request port 
Python :: convert blocks to mb python 
Python :: random list 
Python :: typer python 
Python :: ope pickle file 
Python :: how to add find the smallest int n in a list python 
Python :: encoding character or string to integer in python 
Python :: How to change application icon of pygame 
Python :: array slicing python 
Python :: from future import division 
Python :: save standard output in variable python 
Python :: Python Zigzag a matrix for dct 
Python :: how to add items to a set in python 
Python :: python stop stdout 
Python :: python filter list 
Python :: global /tmp/pip-req-build-civioau0/opencv/modules/videoio/src/cap_v4l.cpp (587) autosetup_capture_mode_v4l2 videoio(v4l2:/dev/video0): device is busy 
Python :: filtering certain rows in python that contains a part of string 
Python :: reverse list in python 
Python :: store command in discord.py 
Python :: python remove first element of array 
Python :: python download images from unsplash 
Python :: django q example 
Python :: normal discord.py codes 
Python :: check if variable is defined in python 
Python :: txt to image python 
Python :: image deblurring python 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =