Qa database

View or edit on GitHub

This page is synchronized from trase/models/colombia/coffee/qa_database.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).

from trase.tools.pandasdb import read
from tqdm import tqdm
from trase.tools import sps

dfs = {
    # TODO: this is deprecated, use supply_chains_datasets.colombia_coffee_vx.y.z. etc instead
    year: read.read_flows(2825, years=[year])
    for year in tqdm(range(2013, 2022 + 1))
}
df = sps.concat(dfs.values())
import plotly.express as px

px.line(
    sps.consolidate(df, ["volume"], ["year"]),
    x="year",
    y="volume",
)
px.line(
    sps.consolidate(df, ["fob"], ["year"]),
    x="year",
    y="fob",
)
df[df.isna().any(axis=1)]["year"].value_counts()