Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the data_analysis.py to improve performance & readability of code.Fixed spelling mistake in README.md #69

Merged
merged 10 commits into from
Mar 7, 2024
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ modules:
[homebrew]: https://brew.sh/


### Running scripts that require client cedentials
### Running scripts that require client credentials

To successfully run scripts that require client credentials, you will need to
follow these steps:
Expand Down Expand Up @@ -159,4 +159,4 @@ The documentation within the project is licensed under a [Creative Commons
Attribution 4.0 International License][cc-by].

[cc-by-png]: https://licensebuttons.net/l/by/4.0/88x31.png#floatleft "CC BY 4.0 license button"
[cc-by]: https://creativecommons.org/licenses/by/4.0/ "Creative Commons Attribution 4.0 International License"
[cc-by]: https://creativecommons.org/licenses/by/4.0/ "Creative Commons Attribution 4.0 International License"
23 changes: 10 additions & 13 deletions analyze/data_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,16 @@ def tags_frequency(csv_path, column_names):
# customized = {"p", "d", "b"}
# stopwords = stopwords.union(customized)

for word in list_tags:
# Splitting each tag into its constituent words
tokens = word.split()
# Converting each word to lower case
for i in range(len(tokens)):
tokens[i] = tokens[i].lower()
# Adding each word to text
text += " ".join(tokens) + " "
for word in list2:
tokens = word.split()
for j in range(len(tokens)):
tokens[j] = tokens[j].lower()
text += " ".join(tokens) + " "
# Initialize an empty list to store lowercase words
lowercase_words = []

# Iterate over each tag in list_tags and list2
for tag in list_tags + list2:
# Split the tag into words, convert to lowercase,& append to the list.
lowercase_words.extend([word.lower() for word in tag.split()])

# Join the lowercase words with a space separator
text = ' '.join(lowercase_words)

# Creating the word cloud
tags_word_cloud = WordCloud(
Expand Down
Binary file modified analyze/wordCloud_plots/license1_wordCloud.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading