I have a pandas dataframe where one of the columns contains lists:
import pandas as pd
import numpy as np
(
pd.DataFrame({
"x": [[1, 2], [3, 4], [5, 6]]
)}
.assign(x = lambda data: data.x.apply(np.array)) # convert lists into numpy arrays
.to_numpy()
.shape # returns (3, 1) when I was hoping for a (3,1,2)
)
I would like to pass this data into tensorflow as a 3D array, but first I need to be able to get the right shape out of it.
Many thanks!