Skip to content

Commit

Permalink
Add np.ndarray
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Jan 31, 2025
1 parent 3ce10db commit e0034fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spatialpandas/dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ def persist(self, **kwargs):

@make_meta_obj.register(GeoSeries)
def make_meta_series(s, index=None):
if isinstance(s, np.ndarray):
return s[:0]
result = s.head(0)
if index is not None:
result = result.reindex(index[:0])
Expand Down Expand Up @@ -591,6 +593,8 @@ def __getitem__(self, key):

@make_meta_obj.register(GeoDataFrame)
def make_meta_dataframe(df, index=None):
if isinstance(df, np.ndarray):
return df[:0]
result = df.head(0)
if index is not None:
result = result.reindex(index[:0])
Expand Down

0 comments on commit e0034fe

Please sign in to comment.