segregation.inference.simulate_bootstrap_resample

segregation.inference.simulate_bootstrap_resample(df, **kwargs)[source]

Generate bootstrap replications of the units with replacement of the same size of the original data.

Parameters:
dfgeopandas.GeoDataFrame or pandas.DataFrame

(geo)dataframe with population counts to be randomized

Returns:
DataFrame

DataFrame with bootstrap resampled observations

Notes

Simulate a synthetic dataset by drawing from rows of the input data with replacement until reaching the same number of observations in the original dataframe. Note that if input is a geodataframe, then the output will not be planar-enforced, as more than one of the same unit may appear in the sample.