[Numpy-discussion] array - dimension size of 1-D and 2-D examples

2017-12-30 Thread Vinodhini Balusamy
Hi, I am new to bumpy and started working on basics. I need clarification for the below behaviour. case 1: >>> x12 = np.array([[1,2,3]]) >>> print(x12) [[1 2 3]] >>> x12.ndim 2 >>> Tried creating a 2-D array. also, >>> x12 = np.array([[1,2,3],[0,0,0]]) >>> print(x12) [[1 2 3] [0 0 0]] >>> x

Re: [Numpy-discussion] array - dimension size of 1-D and 2-D examples

2017-12-30 Thread Derek Homeier
On 30 Dec 2017, at 11:37 am, Vinodhini Balusamy wrote: > > Case 2: > >>> > >>> x12 = np.array([[1,2,3],[]]) > >>> x12.ndim > 1 > >>> print(x12) > [list([1, 2, 3]) list([])] > >>> >In case 2, I am trying to understand why it becomes 1 dimentional ?!?! > > > Case 3: > >>> > >>> x12 = np.ar

Re: [Numpy-discussion] array - dimension size of 1-D and 2-D examples

2017-12-30 Thread Vinodhini Balusamy
Thanks Derek for quick clarification. Just one more question from the details you have provided which from my understanding strongly seems to be Design [DEREK] You cannot create a regular 2-dimensional integer array from one row of length 3 > > and a second one of length 0. Thus np.array choo

Re: [Numpy-discussion] array - dimension size of 1-D and 2-D examples

2017-12-30 Thread Derek Homeier
On 30 Dec 2017, at 5:38 pm, Vinodhini Balusamy wrote: > > Just one more question from the details you have provided which from my > understanding strongly seems to be Design > [DEREK] You cannot create a regular 2-dimensional integer array from one row > of length 3 >> and a second one of len