Skip to content

Commit

Permalink
Merge branch 'sort-genres-by-freq'
Browse files Browse the repository at this point in the history
  • Loading branch information
skadogg committed Feb 21, 2024
2 parents 9475922 + ca3879a commit 3eb68ed
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@
# Restore genres from stored .bin file
all_genres = modules.data_bin_convert.bin_to_data('./my_data/saved_data_genres.bin')

# Randomize the lists so you don't just end up with super-popular Action/Adventure movies
# (The output gets sorted later. All is well.)
logging.info('Shuffling data and genres')
# Randomize the list
logging.info('Shuffling data')
random.shuffle(data_list_everything)
random.shuffle(all_genres)

# Sort by genre frequency so you don't just end up with super-popular Action/Adventure movies
all_genres = sorted(all_genres, key = all_genres.count, reverse = False)

# Look through data for keyword matches
# This can be used for special lists (e.g. movies you only watch during the holidays),
Expand Down

0 comments on commit 3eb68ed

Please sign in to comment.