Python Forum
Rank word frequent in a list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rank word frequent in a list
#1
I'm a non-coder type, so sorry if I don't have a clue on how to do this. I have Column in an excel spreadsheet with hospital names. I want to basically count the number of time the same word or word phrase appears in the list. So for this short lists (which it is not) of
"Dallas Medical Center"
Hospital of Dallas"
"Presbyterian Medical Hospital"

I would like a like for the code to give "Medical", "Hospital" and "Dallas" a rank of 2; "Center", and "Presbyterian" a rank of 1 Thanks so much.
Reply
#2
You can do it without having to write a line of python: https://kb.nmsu.edu/page.php?id=75271

should you want a python script, simply save the sheet as a csv file, read it into python, count the words.
should take an hour or so to learn enough python to do this.
If you try this, we will be glad to help, but we don't typically write code, if you really don't want to write code, and stll want a python script, ask for post to be moved to jobs, and offer compensation.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  For Word, Count in List (Counts.Items()) new_coder_231013 6 2,500 Jul-21-2022, 02:51 PM
Last Post: new_coder_231013
  find some word in text list file and a bit change to them RolanRoll 3 1,482 Jun-27-2022, 01:36 AM
Last Post: RolanRoll
Question Problem: Check if a list contains a word and then continue with the next word Mangono 2 2,455 Aug-12-2021, 04:25 PM
Last Post: palladium
  Trying to get the first letter of every word in a list DanielCook 2 2,102 Jan-05-2021, 05:06 PM
Last Post: deanhystad
  Trying to find first 2 letter word in a list of words Oldman45 7 3,635 Aug-11-2020, 08:59 AM
Last Post: Oldman45
  Cant Append a word in a line to a list err "str obj has no attribute append Sutsro 2 2,525 Apr-22-2020, 01:01 PM
Last Post: deanhystad
  Python Speech recognition, word by word AceScottie 6 15,866 Apr-12-2020, 09:50 AM
Last Post: vinayakdhage
  print a word after specific word search evilcode1 8 4,725 Oct-22-2019, 08:08 AM
Last Post: newbieAuggie2019
  How do you replace a word after a match from a list of words in each line of a file? vijju56 1 3,418 Oct-17-2019, 03:04 PM
Last Post: baquerik
  returns index of list if contains a word zarize 0 1,800 Sep-09-2019, 09:29 AM
Last Post: zarize

Forum Jump:

User Panel Messages

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