scanpy.datasets.blobs

Contents

scanpy.datasets.blobs#

scanpy.datasets.blobs(*, n_variables=11, n_centers=5, cluster_std=1.0, n_observations=640, rng=None)[source]#

Gaussian Blobs.

Parameters:
n_variables int (default: 11)

Dimension of feature space.

n_centers int (default: 5)

Number of cluster centers.

cluster_std float (default: 1.0)

Standard deviation of clusters.

n_observations int (default: 640)

Number of observations. By default, this is the same observation number as in scanpy.datasets.krumsiek11().

rng int | integer | Sequence[int] | SeedSequence | Generator | BitGenerator | None (default: None)

Random number generation to control stochasticity.

If a type:SeedLike value, it’s used to seed a new random number generator; If a numpy.random.Generator, rng’s state will be directly advanced; If None, a non-reproducible random number generator is used. See numpy.random.default_rng() for more details.

The default value matches legacy scanpy behavior and will change to None in scanpy 2.0.

Return type:

AnnData

Returns:

Annotated data matrix containing a observation annotation ‘blobs’ that indicates cluster identity.

Examples

>>> import scanpy as sc
>>> sc.datasets.blobs()
AnnData object with n_obs × n_vars = 640 × 11
    obs: 'blobs'