Skip to content

Commit

Permalink
remove pandas
Browse files Browse the repository at this point in the history
  • Loading branch information
= Enea_Gore committed Jan 25, 2025
1 parent 20a7ad4 commit 3b47dc9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
25 changes: 14 additions & 11 deletions modules/text/module_text_llm/module_text_llm/analytics/analytics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
import plotly.figure_factory as ff
Expand All @@ -8,21 +7,25 @@ def test_visualization(data):
html_explanation = """
<h2 style="text-align: center;">Total Credits awarded by each model on each submission</h2>
"""
rows = []
for submission_id, approaches in data.items():
for approach, credits in approaches.items():
rows.append({"submission_id": submission_id, "approach": approach, "total_credits": sum(credits)})
submission_ids = []
approaches = []
total_credits = []

for submission_id, approaches_data in data.items():
for approach, credits in approaches_data.items():
submission_ids.append(submission_id)
approaches.append(approach)
total_credits.append(sum(credits))

df = pd.DataFrame(rows)
fig = px.bar(
df,
x="submission_id",
y="total_credits",
color="approach",
x=submission_ids,
y=total_credits,
color=approaches,
barmode="group",
title="Total Credits by Approach for Each Submission ID",
labels={"submission_id": "Submission ID", "total_credits": "Total Credits", "approach": "Approach"}
labels={"x": "Submission ID", "y": "Total Credits", "color": "Approach"}
)

return {"fig": fig, "html_explanation": html_explanation}


Expand Down
1 change: 0 additions & 1 deletion modules/text/module_text_llm/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ gitpython = "3.1.41"
nltk = "3.9.1"
python-dotenv = "1.0.0"
tiktoken = "0.7.0"
pandas = "2.2.3" #try to remove this too
plotly = "5.24.1"

[tool.poetry.dev-dependencies]
Expand Down

0 comments on commit 3b47dc9

Please sign in to comment.