0

I am new with Python but I would like to see the frequency of words used in titles of games, which are in the first column named "Name" (from a dataset of Kaggle "Video Games with Ratings").

Thus, I am trying to have a sort of a list with "word" & frequency (e.g: "hero" : 4 "pokemon": 8)

I tried to use most.common() but it doesn't work. Could someone help me and comment their answer ?

Thank you and have a nice day/evening !

Asline88
  • 19
  • 1
  • 1
  • 2
  • 1
    Can you provide more context here? What libraries (and versions) are you using, which python version are you using? `most.common()` doesn't make much sense out of context – Ryan Baker Nov 11 '17 at 20:18
  • 1
    @cᴏʟᴅsᴘᴇᴇᴅ this is definitely not a duplicate because the OP has not provided enough information to allow for determination if this question is unique, such as what the file/dataset looks like. – Ajax1234 Nov 11 '17 at 20:20
  • @Ajax1234 Without any code or MCVE, anything vaguely resembling this would be a duplicate, just because of the vagueness... I'd love to reopen it if OP clarifies, otherwise there's no real point - might as well close on grounds of being too broad. – cs95 Nov 11 '17 at 20:21
  • @Ajax1234 No, I'm not going to reopen this until OP edits their post. You yourself admitted that OP has not provided enough information in the question, so that automatically qualifies as "Too Broad". Why even bother reopening? – cs95 Nov 11 '17 at 20:24
  • Hello ! Sorry I am new with Python and this forum so I don't know the guidelines. I am using Python3 and I have tried these two codes separately: df(' '.join(df["Name"]).lower().split()).value_counts()[:10] from collections import Counter counts = Counter(df["Name"]) print(counts) – Asline88 Nov 11 '17 at 20:25
  • Good, see here: https://stackoverflow.com/questions/36004976/count-frequency-of-values-in-pandas-dataframe-column – cs95 Nov 11 '17 at 20:28
  • @Ajax1234 After OP's clarification, do you think it's a duplicate now? I certainly do. – cs95 Nov 11 '17 at 20:28
  • @cᴏʟᴅsᴘᴇᴇᴅ No, I do not think it is a duplicate, because the OP's problem itself is specific to a different dataframe than the one in stackoverflow.com/questions/36004976/. I think marking this question as "too broad" would be a better way to go. – Ajax1234 Nov 11 '17 at 20:32
  • @Ajax1234 That's like saying, "my question is asking about '1 + 1' but the duplicate shows you how to do '2 + 2', the numbers are different so it isn't a dupe"... – cs95 Nov 11 '17 at 20:33

0 Answers0