I want to create a multidimensional array with a predefined size. In C I would do the following:
int multi_array[5][6][7];
How do I create such thing in Python?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
note: This array will contain whatever junk happened to be in the unallocated memory at the time of creation. You may prefer to use this form if you are going to populate it with data later, for efficiency. Otherwise you might prefer to use
np.zerosinstead.