Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: need at least one array to concatenate #6

Closed
1810174827 opened this issue Apr 28, 2024 · 2 comments
Closed

ValueError: need at least one array to concatenate #6

1810174827 opened this issue Apr 28, 2024 · 2 comments

Comments

@1810174827
Copy link

Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\pylandstats\landscape.py", line 610, in _patch_area_ser
return self._cached_patch_area_ser
AttributeError: 'Landscape' object has no attribute '_cached_patch_area_ser'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\lhflearn\指数计算\landscape level1.py", line 14, in
landscape_metrics_df = za.compute_landscape_metrics_df(metrics=metrics)
File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\pylandstats\multilandscape.py", line 233, in compute_landscape_metrics_df
] = landscape.compute_landscape_metrics_df(
File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\pylandstats\landscape.py", line 3942, in compute_landscape_metrics_df
metrics_dict[metric] = getattr(self, metric)(**metric_kws)
File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\pylandstats\landscape.py", line 1710, in area_mn
return self._metric_mn(
File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\pylandstats\landscape.py", line 791, in _metric_mn
return self._metric_reduce(
File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\pylandstats\landscape.py", line 777, in _metric_reduce
patch_metrics = patch_metric_method(
File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\pylandstats\landscape.py", line 881, in area
area_ser = self._get_patch_area_ser(class_val=class_val)
File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\pylandstats\landscape.py", line 726, in _get_patch_area_ser
patch_area_ser = self._patch_area_ser
File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\pylandstats\landscape.py", line 613, in _patch_area_ser
np.concatenate(
File "<array_function internals>", line 5, in concatenate
ValueError: need at least one array to concatenate

进程已结束,退出代码1

@1810174827
Copy link
Author

File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\pylandstats\landscape.py", line 610, in _patch_area_ser
return self._cached_patch_area_ser
AttributeError: 'Landscape' object has no attribute '_cached_patch_area_ser'

@martibosch
Copy link
Owner

Closing this since I am assuming that this is actually the same as pylandstats issue 49. Feel free to reopen otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants