Useful algorithms.

ci – determine a confidence interval by boostrapping.

percentiles – find percentiles in an array.

bootstrap – resample (with replacement) and store aggregate values., func, which=95, boots=1000)[source]

Determine the confidence interval of a function applied to a data set by bootstrapping.

  • data (pandas.DataFrame) – The data to resample.

  • func (callable) – A function that is called on a resampled data

  • which (int) – The percentile to use for the confidence interval

  • boots (int (default = 1000):) – How many times to bootstrap


The confidence interval.

Return type

(float, float)

cytoflow.utility.algorithms.percentiles(a, pcts, axis=None)[source]

Like scipy.stats.scoreatpercentile but can take and return array of percentiles.

from seaborn:

  • a (array) – data

  • pcts (sequence of percentile values) – percentile or percentiles to find score at

  • axis (int or None) – if not None, computes scores over this axis


scores – array of scores at requested percentiles first dimension is length of object passed to pcts

Return type


cytoflow.utility.algorithms.bootstrap(*args, **kwargs)[source]

Resample one or more arrays with replacement and store aggregate values. Positional arguments are a sequence of arrays to bootstrap along the first axis and pass to a summary function.

  • n_boot (int, default 10000) – Number of iterations

  • axis (int, default None) – Will pass axis to func as a keyword argument.

  • units (array, default None) – Array of sampling unit IDs. When used the bootstrap resamples units and then observations within units instead of individual datapoints.

  • smooth (bool, default False) – If True, performs a smoothed bootstrap (draws samples from a kernel destiny estimate); only works for one-dimensional inputs and cannot be used units is present.

  • func (callable, default np.mean) – Function to call on the args that are passed in.

  • random_seed (int | None, default None) – Seed for the random number generator; useful if you want reproducible resamples.


  • array – array of bootstrapped statistic values

  • from seaborn (

cytoflow.utility.algorithms.is_inside_sm(polygon, point)[source]
cytoflow.utility.algorithms.polygon_contains(points, polygon)[source]