# skbio.diversity.alpha_diversity

`skbio.diversity.``alpha_diversity`(metric, counts, ids=None, validate=True, **kwargs)

  Compute alpha diversity for one or more samples

  State: Experimental as of 0.4.1.

  Parameters:

  metric : str, callable

  > The alpha diversity metric to apply to the sample(s). Passing metric as a string is preferable as this often results in an optimized version of the metric being used.

  counts : 1D or 2D array_like of ints or floats

  > Vector or matrix containing count/abundance data. If a matrix, each row should contain counts of OTUs in a given sample.

  ids : iterable of strs, optional

  > Identifiers for each sample in `counts`. By default, samples will be assigned integer identifiers in the order that they were provided.

  validate: bool, optional

  > If False, validation of the input won’t be performed. This step can be slow, so if validation is run elsewhere it can be disabled here. However, invalid input data can lead to invalid results or error messages that are hard to interpret, so this step should not be bypassed if you’re not certain that your input data are valid. See `skbio.diversity` for the description of what validation entails so you can determine if you can safely disable validation.

  kwargs : kwargs, optional

  > Metric-specific parameters.

  Returns:

  pd.Series

  > Values of `metric` for all vectors provided in `counts`. The index will be `ids`, if provided.

  Raises:

  ValueError, MissingNodeError, DuplicateNodeError

  > If validation fails. Exact error will depend on what was invalid.

  TypeError

  > If invalid method-specific parameters are provided.

  See also

  `skbio.diversity`, `skbio.diversity.alpha`, `skbio.diversity.get_alpha_diversity_metrics`, `skbio.diversity.beta_diversity`