Python Programming Tutorial - 37 - Word Frequency Counter (3/3)

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

for anyone like me who was confused by how the "word_count" works, here is my explanation :
1:word_count = {} here is a empty dictionary
2:word_count[word] = 1 is equivalent of word_count.update({word:1}) # add "word" and set its value to 1 if it does not exist in the empty dictionary "word_count", which every "word" is not, so python keeps adding word with value 1 to "word_count" dictionary until "if word in word count" then add 1 to the value of that "word"

Hope this helps and let me know if anything i stated is incorrect.

poseidonericsson
Автор

Actually python is used for multiplying vectors and matrices and other machine learning/data analysis computations.  It's a very powerful language for that regard.

Bucky your the man, keep it up boss.

irvdo
Автор

Thanks Bucky for these awesome videos.
I like you the fact that you now make simple programs with the things you showed us, to give us an understanding on how to use them. It's a very nice way of doing it :D
keep on the good work!!!

profhaxable
Автор

Mannn. . . . .No words to express. . .  YOu are awesomeeee. . . .

laharishguntuka
Автор

another way to create a dictionary that contains the words and their count:

word_count = {}

for word in clean_word_list:
if word not in word_count:
word_count[word] = clean_word_list.count(word)

MiledRizk
Автор

Your python tutorial series gave me a good programming project idea :D

ewliang
Автор

Your videos are so helpful, people should like them more!

ausseriridische
Автор

Well, the first 2 videos were quite fine but I can't say the same thing for the last one. Because, first of all you created a method called "clean_up_list" which gets rid of all the unwanted symbols of the words. But in this method you also call another method which creates dictionary to count frequency. I think it is not a good idea to call that method inside "clean_up_list" method because that method supposed to clean up words, not creating dictionary. Therefore I don't think you should call that method inside that method. On the other hand, you are using "operator" class to count frequency, which is actually not complicated job. I was expecting to see some efficient algoritm to do that.

In any case, your videos are really simple and easy to understand. I am glad you are doing this. Thank you so much! :)

ahmetozdemir
Автор

Bucky - I use these in a classroom.  If you could go back to doing full HD/1080 that would help, as I project this on a screen as I heckle ... er ... make insightful comments.

GonsalvoDeCordova
Автор

Love your tutorials. Fantastic. But the dark background makes it difficult to see some of the text that does not contrast drastically with the background. I realize this may be a late recommendation but thought you might like to know anyway. Keep up the great work.

timothywynne
Автор

Great tutorial series! This seems fine for most words but as the apostrophes have been taken out and the text is all lower case, words like I'll and ill will be counted as one word. How can this be fixed?

Danzi
Автор

I know a lot of people are doing fine with this but this topic and webcrawlers but I cannot get them to work in 2022 even if I follow the code to a tee and use alternative websites. It seems like every modern website has built in functionality to block web crawlers. Can someone please tell me is it truly necessary to work with webcrawlers in python? it seems they're more trouble than they are worth.

gio
Автор

it is amazing what a few lines of python can do.. wow

GtaRockt
Автор

Hi man, I've a question: Is this thing BeautifulSoup able to parse the code generated in Javascript to python? Imagine I have some sort of database which is only read on the browser but does not appear in the html source.

speciallyupv
Автор

how come word_count itself printing the word and the no. of times it occured. as it only saves frequency of word

himanshuaggarwal
Автор

Thanks bucky!, bucky get into more in depth to Python, i like how you teach, idk like photoshop series +100 videos we would be so happy!

syknz
Автор

I have got this error ---->> "for key, value in sorted(word_count.items(), key=operator.itemgetter(1)):
^
IndentationError: unindent does not match any outer indentation level"

umedzhonizbasarov
Автор

word = word.replace(symbols[i], "")
This line is different in video from line in source code on forum.

nejcmeister
Автор

AttributeError: 'Response' object has no attribute 'txt'

i m getting this error, every time i do this typ of programm

sangrampatra
Автор

for key, value in sorted(word_count.items(), key=operator.itemgetter(1)):
^
IndentationError: unindent does not match any outer indentation level

jrM
welcome to shbcf.ru