My dataframe look like this
a = pd.DataFrame({'x': {0: 'John', 1: 'Ron', 2: 'Don'},
'y': {0: [['Apple','Apple','Apple'],['Ball','Ball'],['Cat']], 1: [['Zebra','Zebra'],['Fox','Fox']], 2: [['Elf'],['Ball','Ball']]}})
Where 'x' refers to documents and 'y' refers to terms (repeated for how many times they occur)
I want to pass it to :
v = TfidfVectorizer()
z = v.fit_transform(a)
In my read data, this just give me
z.toarray()
>array([[1.]])
Which makes no sense?