randomly_downsample_data¶
- halotools.utils.randomly_downsample_data(array, num_downsample, seed=None)[source]¶
Method returns a length-num_downsample random downsampling of the input array.
- Parameters:
- arrayarray
- num_downsampleint
Size of the desired downsampled version of the data
- Returns:
- downsampled_arrayarray 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)