Homework Discussions for the Basic Python Workshop

Discuss the homework here!

Do include a plot of your final histogram in your post!

Here is the homework submission form: https://forms.gle/Yne98J3LqR2jQg5d9

If you’d like to get a certificate for this workshop, you must attempt the quiz questions in the Google Form and upload your homework solution notebook (the extension of which must be .ipynb).


These are the results I have obtained, although I think words like ‘us’ are not included in the stopwords list. ‘brutus.’ is the most used word in the text.


Also, I think there are punctuations being mixed with the words, as there is a ‘brutus.’ and ‘brutus’

1 Like

python_homework_GHF_class 1

I cleaned the string from punctuations and got this plot


Nice Job, folks! @adityadoomra10 great job on removing punctuations! Do share your strategy for this removal so we can all learn.

Everyone, that was not part of the homework but I want to complement @adityadoomra10 on his attention to detail, always a good thing for us data scientist sorts…

fd = open("data/JuliusCaesar.txt")
word_string = fd.read().lower()
punctuation = '!()-[]{};:"\,<>./?@#$%^&*_~'
for element in word_string:
    if element in punctuation:
        word_string = word_string.replace(element, "")

I did not remove apostrophe as that would cause words like won’t to change into wont and that would cause problems in removing the stop words
Hope this helps everyone!


Histogram with few tweaks in color, positioning, etc.

You can visit the notebook here.


Great job @uzairk ! It’s commendable that you went ahead and explored the Seaborn library, its color schemes, and also annotated your bars in the plot.

It’s also worth mentioning that you are maintaining a Github profile which helps you in showcasing your skills and stay organized. I would encourage other community members to do the same. It is one of the tools you can keep in your arsenal of self-branding as a programmer to give you that extra edge.

And do share your cool projects related to ML and Data Science in the Your Portfolio section.

Where should we submit our homework?


Can you share JuliusCaesar.txt file with us. I am unable to find it online.

Hi @ch14d016 ! You can find all the datasets that we have used in our Basic Python Exercises and Homeworks at https://github.com/univai-ghf/PythonWorkshop/tree/main/data

Where and how should I submit my homework? I haven’t received any mails regarding that.

Where and how should we submit our homework?


We’ll put a link at the top of this thread soon and send an email out with that link as well!

@ch14d016 @melvinsamv @tejas55 We appreciate your enthusiasm and patience. The homework submission link is active now and you can find it at the top of this thread here.

We hope to see your submission soon!

i think this is it

Good evening!
How can I watch the recording of the ‘Basic Python Workshop’?
I have a trouble loading the recordings of all of the workshops I have attended.
I would be greatly helped if you could guide me on it.



Great job @sanjay_ug_s . You can go a step further by cleaning the punctuations so that words like “brutus.”, “brutus,”, “brutus” etc. are treated as one word “brutus”.

You can refer to the strategy shared by @adityadoomra10 here or to the notebook shared by @uzairk here.

yeah surely thanks for the review

Hi everyone!
From the code i am able to figure out that after every character there is a colon printed, but i am unable to figure out why does before the line starts there is a colon similarly for the case of last line(there is a colon for friends , why is there a another colon) .
Can anyone please help out