Python Forum
How to count value after a textblob
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to count value after a textblob
#1
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 :)
Reply
#2
I haven't looked at your screenshots, but you should be posting: (1) in code tags, full, minimal, runnable code that reproduces your issue and (2) the full stacktrace (your TypeError was in there). The less code you post (assuming it's runnable!), the more likely you are to get a helpful reply and a fast reply.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Row Count and coloumn count Yegor123 4 1,268 Oct-18-2022, 03:52 AM
Last Post: Yegor123
  Issue In Loading Textblob in jupyter Shivi_Bhatia 1 6,800 Apr-01-2019, 06:50 PM
Last Post: perfringo
  How to declare TextBlob var 3115Tech 2 2,684 Apr-21-2018, 07:04 PM
Last Post: 3115Tech
  Textblob issue on 3.5 Sebt1890 2 2,789 Mar-01-2018, 09:39 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020