randomly_downsample_data

halotools.utils.randomly_downsample_data(array, num_downsample, seed=None)[source] [edit on github]

Method returns a length-num_downsample random downsampling of the input array.

Parameters:

array : array

num_downsample : int

Size of the desired downsampled version of the data

Returns:

downsampled_array : array or Astropy Table

Random downsampling of the input array

Examples

>>> x = np.linspace(0, 1000, num=int(1e5))
>>> desired_sample_size = int(1e3)
>>> downsampled_x = randomly_downsample_data(x, desired_sample_size)