Skip to content

Commit

Permalink
make ratings_df and games_df smaller before merging to main df
Browse files Browse the repository at this point in the history
  • Loading branch information
threnjen committed Dec 17, 2024
1 parent bc6d167 commit 5bdb4be
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions modules/rag_description_generation/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,17 @@ def merge_game_df_with_ratings_df(self, game_df_reduced):
file_name="ratings_data.pkl",
)
ratings_df["BGGId"] = ratings_df["BGGId"].astype("string")
ratings_df = ratings_df[["username", "BGGId", "rating"]]

game_df_reduced = game_df_reduced[
["BGGId", "Name", "Description", "AvgRating", "BayesAvgRating"]
]

print(
f"Reducing user ratings to only include games in the reduced game dataframe\n"
)
all_games_df = ratings_df.merge(
game_df_reduced[
["BGGId", "Name", "Description", "AvgRating", "BayesAvgRating"]
],
game_df_reduced,
on="BGGId",
how="inner",
)
Expand Down

0 comments on commit 5bdb4be

Please sign in to comment.