[[+content_image]]
G
G
gugobulk2021-05-25 23:43:08
Python
gugobulk, 2021-05-25 23:43:08

How to form a numpy array with 3 brackets?

Good day. I am a beginner and don't know much. Tell me, please, how to make this [ [[42 49 ] [[42 49]] from this

[[ 24 100]
[ 24 100]
[ 25 99]
[ 25 99]
[ 95 4]] ]] [[61 4]]] I need to keep the format somehow. I don't understand how there are double brackets everywhere. Thank you!







Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
A
alfss, 2021-05-25
@alfss

np.ones( (2,3,4), dtype=np.int16 )

np.arange(24).reshape(2, 3, 4)

np.array([[[1, 2], [3, 4]], [[5, 6], [7, 8]]])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question