If I have a list of pd.DataFrame like so:
df = pd.DataFrame(np.random.rand(4,5), columns = list('abcde'))
df_list = [df, df]
Question:
How can I convert it to a 3D np.array with shape (2, 3, 5)?
I tried to do np.array(df_lsit), but I get the following error:
ValueError: cannot copy sequence with size 4 to array axis with dimension 5
np.stack(df_list)?