Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
burggraaff committed Aug 22, 2024
1 parent b1dab91 commit fb7c960
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions fpcup/geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
gpd.options.io_engine = "pyogrio"
import h3pandas
import numpy as np
import pandas as pd
pd.options.mode.chained_assignment = None
from pandas import DataFrame, Series
from shapely import Geometry, Point, Polygon
from tqdm import tqdm
Expand Down
4 changes: 2 additions & 2 deletions process_brp.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# Remove unnecessary columns and translate to English
brp.drop(columns=["jaar", "status"], inplace=True)
brp.rename({"gewas": "crop", "gewascode": "crop_code"}, axis=1, inplace=True)
brp["category"].replace(fpcup.site.brp_categories_NL2EN, inplace=True)
brp.replace({"category": fpcup.site.brp_categories_NL2EN}, inplace=True)

# Add province information
fpcup.geo.add_provinces(brp)
Expand Down Expand Up @@ -54,7 +54,7 @@

# Select fpcup crops
brp_fpcup = brp_agro.loc[brp_agro["crop"].isin(fpcup.crop.brp_crops_NL2EN)]
brp_fpcup["crop"].replace(fpcup.crop.brp_crops_NL2EN, inplace=True)
brp_fpcup.replace({"crop": fpcup.crop.brp_crops_NL2EN}, inplace=True)
if args.verbose:
print(f"Reduced file to crops listed in the FPCUP/BRP dictionary -- {len(brp_fpcup)} entries")

Expand Down

0 comments on commit fb7c960

Please sign in to comment.