How do I create a 0 x 0 (i.e. ndim= 2, shape= (0,0)) float numpy.ndarray?
How do I create a 0 x 0 (i.e. ndim= 2 , shape= (0,0)
Share
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.
The array above is initialized as a 2D array–i.e., two size parameters passed for shape.
Second, the call to empty is not strictly necessary–i.e., an array having 0 size could (i believe) be initialized using other array-creation methods in NumPy, e.g., NP.zeros, Np.ones, etc.
I just chose empty because it gives the smallest array (memory-wise).