We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 864c0a2 commit b7b0a24Copy full SHA for b7b0a24
1 file changed
mudata/_core/mudata.py
@@ -393,6 +393,10 @@ def shape(self) -> Tuple[int, int]:
393
"""Shape of data, all variables and observations combined (:attr:`n_obs`, :attr:`n_var`)."""
394
return self.n_obs, self.n_vars
395
396
+ def __len__(self) -> int:
397
+ """Length defined as a total number of observations (:attr:`n_obs`)."""
398
+ return self.n_obs
399
+
400
# # Currently rely on AnnData's interface for setting .obs / .var
401
# # This code implements AnnData._set_dim_df for another namespace
402
# def _set_dim_df(self, value: pd.DataFrame, attr: str):
0 commit comments