rapids_singlecell.pp.log1p#
- rapids_singlecell.pp.log1p(adata, *, layer=None, obsm=None, inplace=True, copy=False)[source]#
Calculated the natural logarithm of one plus the sparse matrix.
- Parameters:
- adata AnnData
AnnData object
- layer str | None (default:
None
) Layer to normalize instead of
X
. IfNone
,X
is normalized.- obsm str | None (default:
None
) Entry of obsm to transform.
- inplace bool (default:
True
) Whether to update
adata
or return the matrix.- copy bool (default:
False
) Whether to return a copy or update
adata
. Not compatible with inplace=False.
- Return type:
AnnData | sparse.spmatrix | cp.ndarray | None
- Returns:
The resulting sparse matrix after applying the natural logarithm of one plus the input matrix. If
copy
is set to True, returns the new sparse matrix. Otherwise, updates theadata
object in-place and returns None.