hpcflow.sdk.core.values.load_txt_values#

hpcflow.sdk.core.values.load_txt_values(fname, num_samples=None, seed=None, replace=False, **kwargs)#

Load an array from a text file with Numpy’s loadtxt, optionally randomly sampling rows (items along the first axis) from it.

Parameters:
  • fname (str | Path) – Path to the text file.

  • num_samples (int | None) – If specified, the number of rows to randomly sample from the loaded array.

  • seed (int | list[int] | None) – Seed for the random number generator used to sample rows.

  • replace (bool) – Whether to sample rows with replacement.

  • kwargs – Additional keyword arguments passed to numpy.loadtxt.

Return type:

NDArray