Skip to content

Commit

Permalink
#206 address deprecation warning in shoreline.py concat empty dataframes
Browse files Browse the repository at this point in the history
  • Loading branch information
2320sharon committed Mar 26, 2024
1 parent 639c29e commit da568c6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/coastseg/shoreline.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

# External dependencies imports
import geopandas as gpd
import pandas as pd
from pandas import concat

# from fiona.errors import DriverError
Expand Down Expand Up @@ -301,7 +302,12 @@ def create_geodataframe(
self.get_clipped_shoreline(file, bbox, columns_to_keep)
for file in shoreline_files
]
shorelines_gdf = concat(shorelines, ignore_index=True)
# shorelines_gdf = concat(shorelines, ignore_index=True)
# Drop columns where all values are NA
shorelines = [df.dropna(axis=1, how='all') for df in shorelines]

# Concatenate the DataFrames
shorelines_gdf = pd.concat(shorelines, ignore_index=True)
# clean the shoreline geodataframe
shorelines_gdf = self.preprocess_service(shorelines_gdf, columns_to_keep)
validate_geometry_types(
Expand Down

0 comments on commit da568c6

Please sign in to comment.