I'm trying to calculate the mean of a column which contains a lists/series but get an error while doing so. The example dataframe as follows:
import pandas as pd
df = pd.DataFrame({'a': [[1,2,3]]})
df ['a'].mean()
The error as follows:
Could not convert [1, 2, 3] to numeric.
Not sure why this happens and how to fix it. Can someone please help? thanks
df['a'].apply(np.mean)