Skip to content

Commit

Permalink
fix wordcloud 2
Browse files Browse the repository at this point in the history
  • Loading branch information
paulzierep committed Aug 12, 2024
1 parent 17611cc commit e6ffbf3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/create_wordcloud.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python

import argparse
from typing import Dict

import matplotlib.pyplot as plt
import numpy as np
Expand All @@ -9,7 +10,7 @@
from wordcloud import WordCloud


def prepare_data(table_path: str, name_col: str, stat_col: str) -> pd.Series:
def prepare_data(table_path: str, name_col: str, stat_col: str) -> Dict:
"""
Prepare data to create dictionary with key being the name and
value the stat/counts
Expand All @@ -28,7 +29,7 @@ def prepare_data(table_path: str, name_col: str, stat_col: str) -> pd.Series:
table[stat_col] = table[stat_col].fillna(value=0)

# create dictionary with key being the name and value the stat/counts
freq = pd.Series(table[stat_col].values, index=table[name_col]).to_dict()
freq = pd.Series(table[stat_col].values, index=table[name_col]).to_dict() # type: Dict

return freq

Expand Down

0 comments on commit e6ffbf3

Please sign in to comment.