Skip to content

Commit

Permalink
Merge pull request #20 from KTH-dESA/camilo/water_demand_bugs
Browse files Browse the repository at this point in the history
added code to be able to set cropland share in several areas at once
  • Loading branch information
camiloramirezgo authored Nov 4, 2019
2 parents 5f16407 + 4735bd4 commit 5be15f8
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 146 deletions.
2 changes: 1 addition & 1 deletion nexus_tool/water_demand.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def set_cropland_share(df, crop_var, geo_boundary = 'global',
if crop_share not in df.columns:
df[crop_share] = [{}]*df.shape[0]

df.loc[df[geo_boundary]==boundary_name, crop_share] = [crop_var]
df.loc[df[geo_boundary].isin(boundary_name), crop_share] = [crop_var]
else:
print('Please provide a geo_boundary (e.g. "Province") and a boundary_name (e.g. "Name of province")')
return df
Expand Down
Loading

0 comments on commit 5be15f8

Please sign in to comment.