Main

View or edit on GitHub

This page is synchronized from trase/models/peru/coffee/main.ipynb. Last modified on 2025-12-14 23:19 CET by Trase Admin. Please view or edit the original file there; changes should be reflected here after a midnight build (CET time), or manually triggering it with a GitHub action (link).

%configure_logging

from trase.tools.sps import SupplyChain

for year in [2019, 2020, 2021, 2022]:
    supplychain = SupplyChain("peru/coffee", year)
    supplychain.preparation()
    supplychain.load()
    supplychain.export_results()
    supplychain.upload_results()
import pandas as pd

df = pd.read_csv(
    f"/usr/share/TRASE/trase/models/peru/coffee/2020/results/results.csv",
    dtype=str,
    sep=";",
)
df["VOLUME_TRADED"] = df["VOLUME_TRADED"].astype(float)
df[df["HS6"] == "210112"]["VOLUME_TRADED"].sum()