Main

View or edit on GitHub

This page is synchronized from trase/models/indonesia/national_palm_oil/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 [2017, 2018, 2019, 2020, 2021]:
    supplychain = SupplyChain("indonesia/national_palm_oil", year)
    supplychain.preparation()
    supplychain.load()
    supplychain.export_results()
    supplychain.upload_results()
import pandas as pd
from trase.tools.sps import SupplyChain

df = supplychain.get("flows")
df["COUNTRY_OF_ORIGIN"] = "NA"
df["HS6"] = df["HS"].str[:6]
df["YEAR"] = pd.to_datetime(df["DATE"]).dt.year

df.loc[df["COUNTRY"] == "INDIA", "COUNTRY"] = "UNKNOWN"
df