0

I'm trying to create a multidimensional array of 5 dimensions like the "array" function in R but in Python.

Here is my array function in R

myarray <- array(0,dim=c(A,B,C,D,E))

A=10, B=5, C=22, D=4 and E=2.

You can find an R image with the expected array as output in the following link

https://www.dropbox.com/sh/bkp10w62bb2xsqg/AABsFh5qv_7E5wLbg_Iux3jka?dl=0

Thanks.

Raúl

2 Answers 2

2
import numpy as np
myshape = (10,5,22,4,2) 
myarray = np.zeros(myshape) 
Sign up to request clarification or add additional context in comments.

Comments

1

In python you can create a dictionary like :

    a = {'A':[],'B':[],'C':[],'D':[],'E':[]}

you can also use list inside list, but dictionary is more efficient way of storing the data.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.