When reading saved data from CSV (particularly arrays etc) we might need to stack them before use else it often results in "jagged array" issues which includes errors like "TypeError: only length-1 arrays can be converted to Python scalars", "ValueError: setting an array element with a sequence." etc.
A simple new_arr = np.stack(old_arr) fixes the issue in most cases.
Take a simple 100 by 50 array:
command: print(type(old_arr), old_arr.shape, old_arr[0].shape, old_arr.dtype
old type & shape & array type: <class 'numpy.ndarray'> (100,) (50,) object
new_arr = np.stack(old_arr). After this
command: print(type(new_arr), new_arr.shape, new_arr.dtype
new type & shape & array type: <class 'numpy.ndarray'> (100,50) float32