singhsidhukuldeep commited on
Commit
7e1d8eb
·
verified ·
1 Parent(s): a1d5d83

made sure all `metrics` are int

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -52,6 +52,10 @@ df["Name"] = df.author.apply(lambda x: x["fullname"])
52
  df["username"] = df.author.apply(lambda x: x["name"])
53
  df["totalReactions"] = df.reactions.apply(lambda x: sum([_["count"] for _ in x]))
54
  df["Num of posts"] = 1
 
 
 
 
55
  data = (
56
  df.groupby(["username", "Name"])[metrics]
57
  .sum()
 
52
  df["username"] = df.author.apply(lambda x: x["name"])
53
  df["totalReactions"] = df.reactions.apply(lambda x: sum([_["count"] for _ in x]))
54
  df["Num of posts"] = 1
55
+
56
+ # Ensure metrics columns are integers
57
+ df[metrics] = df[metrics].astype(int)
58
+
59
  data = (
60
  df.groupby(["username", "Name"])[metrics]
61
  .sum()