Mar-20-2019, 09:03 AM
Hello there,
I made a textblob with this piece of code : info = dataextract['Produit'] .apply(lambda x: TextBlob(x).ngrams(3))
My variable Produit -> https://image.noelshack.com/fichiers/201...apture.png There are more row of course.
I obtained this : https://image.noelshack.com/fichiers/201...pture1.png
I want to count all the occurence of my values in this list but all I get is 'TypeError: unhashable type: 'list''
So I tried this : tf1 = infoframe.apply(lambda x: pd.value_counts(x))
And I obtained this : https://image.noelshack.com/fichiers/201...pture2.png
But that's not exactly what I wanted, I want all the occurence for each term in []
Like all the occurence for [Samsung, Galaxy, S8]
I don't know if I'm clear but if you have any idea, don't hesitate to tell me about.
Thanks :)
I made a textblob with this piece of code : info = dataextract['Produit'] .apply(lambda x: TextBlob(x).ngrams(3))
My variable Produit -> https://image.noelshack.com/fichiers/201...apture.png There are more row of course.
I obtained this : https://image.noelshack.com/fichiers/201...pture1.png
I want to count all the occurence of my values in this list but all I get is 'TypeError: unhashable type: 'list''
So I tried this : tf1 = infoframe.apply(lambda x: pd.value_counts(x))
And I obtained this : https://image.noelshack.com/fichiers/201...pture2.png
But that's not exactly what I wanted, I want all the occurence for each term in []
Like all the occurence for [Samsung, Galaxy, S8]
I don't know if I'm clear but if you have any idea, don't hesitate to tell me about.
Thanks :)