From 7bfa8048b365dfe5b12f5984c7c1f44f3b4c9d9f Mon Sep 17 00:00:00 2001 From: wmv_hpomen Date: Sun, 17 Mar 2024 23:46:58 +0100 Subject: [PATCH] use iloc --- src/spatialdata/models/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spatialdata/models/models.py b/src/spatialdata/models/models.py index 5d8cea0c..4bf1fe75 100644 --- a/src/spatialdata/models/models.py +++ b/src/spatialdata/models/models.py @@ -795,7 +795,7 @@ def _validate_table_annotation_metadata(self, data: AnnData) -> None: if attr[self.INSTANCE_KEY] not in data.obs: raise ValueError(f"`{attr[self.INSTANCE_KEY]}` not found in `adata.obs`.") if (dtype := data.obs[attr[self.INSTANCE_KEY]].dtype) not in [np.int16, np.int32, np.int64, "O"] or ( - dtype == "O" and (val_dtype := type(data.obs[attr[self.INSTANCE_KEY]][0])) != str + dtype == "O" and (val_dtype := type(data.obs[attr[self.INSTANCE_KEY]].iloc[0])) != str ): dtype = dtype if dtype != "O" else val_dtype raise TypeError(