import pandas as pd, json
df = pd.read_excel('/Users/maxim.ziatdinov/Code/SciLink/planning_session_20260319_123553/knowledge/PWSdatabase.xlsx')
elements = ['Li', 'Sr', 'Ba', 'Mg', 'Cu']
for col in elements:
    df[col] = pd.to_numeric(df[col], errors='coerce')
stats = df[elements].agg(['count', 'mean', 'median', 'min', 'max'])
answer = stats.to_dict()
summary = "Statistics (count, mean, median, min, max) for Li, Sr, Ba, Mg, Cu after converting to numeric."
print(json.dumps({"answer": answer, "summary": summary}))
