scanpy.pp.log1p(data, copy=False, chunked=False, chunk_size=None, base=None)

Logarithmize the data matrix.

Computes \(X = \log(X + 1)\), where \(log\) denotes the natural logarithm unless a different base is given.

data : AnnData, ndarray, spmatrixUnion[AnnData, ndarray, spmatrix]

The (annotated) data matrix of shape n_obs × n_vars. Rows correspond to cells and columns to genes.

copy : boolbool (default: False)

If an AnnData is passed, determines whether a copy is returned.

chunked : boolbool (default: False)

Process the data matrix in chunks, which will save memory. Applies only to AnnData.

chunk_size : int, NoneOptional[int] (default: None)

n_obs of the chunks to process the data in.

base : float, NoneOptional[float] (default: None)

Base of the logarithm. Natural logarithm is used by default.

Return type

AnnData, NoneOptional[AnnData]


Returns or updates data, depending on copy.