Qa branches
View or edit on GitHub
This page is synchronized from trase/models/brazil/soy/qa_branches.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 import sps
df = sps.concat(
[
sps.get_pandas_df_once(
f"brazil/soy/sei_pcs/v2.6.1/SEIPCS_BRAZIL_SOY_{year}.csv",
dtype=str,
na_filter=False,
)
for year in [2021, 2022]
]
)
df = df.astype({"VOLUME_RAW": float})
df["BRANCH_SHORT"] = ("Branch " + df["BRANCH"].str.slice(0, 1)).replace(
{"Branch D": "DOMESTIC", "Branch U": "UNKNOWN"}
)
sps.consolidate(df, ["VOLUME_RAW"], ["YEAR", "BRANCH_SHORT"])