made sure all `metrics` are int
Browse files
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()
|