From d1958082eea11a556457d7a07590681bc60885e2 Mon Sep 17 00:00:00 2001 From: Gabriel Tseng Date: Wed, 18 Oct 2023 13:02:01 -0400 Subject: [PATCH] Apply along the right axis --- process_labels/loading_funcs/china.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/process_labels/loading_funcs/china.py b/process_labels/loading_funcs/china.py index 29818ab..49f20dc 100644 --- a/process_labels/loading_funcs/china.py +++ b/process_labels/loading_funcs/china.py @@ -106,7 +106,7 @@ def load_china() -> geopandas.GeoDataFrame: data=df, geometry=geopandas.points_from_xy(df.lon, df.lat), crs=LATLON_CRS ) gdf = df.reset_index(drop=True) - gdf[RequiredColumns.IS_CROP] = df.apply(lambda x: 1 if x.crop == "Crop" else 0) + gdf[RequiredColumns.IS_CROP] = df.apply(lambda x: 1 if x.crop == "Crop" else 0, axis=1) gdf[RequiredColumns.INDEX] = df.index gdf[RequiredColumns.EXPORT_END_DATE] = df.apply( lambda x: datetime(x.year, EXPORT_END_MONTH, EXPORT_END_DAY), axis=1