I have two numpy arrays of arrays (A and B). They look something like this when printed:
A:
[array([0, 0, 0]) array([0, 0, 0]) array([1, 0, 0]) array([0, 0, 0])
array([0, 0, 0]) array([0, 0, 0]) array([0, 0, 0]) array([0, 0, 0])
array([0, 0, 0]) array([0, 0, 0]) array([0, 0, 1]) array([0, 0, 0])
array([1, 0, 0]) array([0, 0, 1]) array([0, 0, 0]) array([0, 0, 0])
array([0, 0, 0]) array([1, 0, 0]) array([0, 0, 1]) array([0, 0, 0])]
B:
[[ 4.302135e-01 4.320091e-01 4.302135e-01 4.302135e-01
1.172584e+08]
[ 4.097128e-01 4.097128e-01 4.077675e-01 4.077675e-01
4.397120e+07]
[ 3.796353e-01 3.796353e-01 3.778396e-01 3.778396e-01
2.643200e+07]
[ 3.871173e-01 3.890626e-01 3.871173e-01 3.871173e-01
2.161040e+07]
[ 3.984899e-01 4.002856e-01 3.984899e-01 3.984899e-01
1.836240e+07]
[ 4.227315e-01 4.246768e-01 4.227315e-01 4.227315e-01
1.215760e+07]
[ 4.433817e-01 4.451774e-01 4.433817e-01 4.433817e-01
9.340800e+06]
[ 4.620867e-01 4.638823e-01 4.620867e-01 4.620867e-01
1.173760e+07]]
type(A), type(A[0]), type(B), type(B[0]) are all <class 'numpy.ndarray'>.
However, A.shape is (20,), while B.shape is (8, 5).
Question 1: Why is A.shape one-dimensional, and how do I make it two-dimensional like B.shape? They're both arrays of arrays, right?
Question 2, possibly related to Q1: Why does printing A show the calls of array(), while printing B doesn't, and why do the elements of the subarrays of B not have commas in-between them?
Thanks in advance.
dtypeof each array? One is an array of arrays, the other a 2D array of floats.