oasislmf.pytools.common.data¶
Attributes¶
Functions¶
|
load a file as a numpy ndarray |
|
load file as a single numpy array, |
|
Module Contents¶
- oasislmf.pytools.common.data.load_as_ndarray(dir_path, name, _dtype, must_exist=True, col_map=None)[source]¶
load a file as a numpy ndarray useful for multi-columns files Args:
dir_path: path to the directory where the binary or csv file is stored name: name of the file _dtype: np.dtype must_exist: raise FileNotFoundError if no file is present col_map: name re-mapping to change name of csv columns
- Returns:
numpy ndarray
- oasislmf.pytools.common.data.load_as_array(dir_path, name, _dtype, must_exist=True)[source]¶
- load file as a single numpy array,
useful for files with a binary version with only one type of value where their index correspond to an id. For example coverage.bin only contains tiv value for each coverage id coverage_id n correspond to index n-1
- Args:
dir_path: path to the directory where the binary or csv file is stored name: name of the file _dtype: numpy dtype of the required array must_exist: raise FileNotFoundError if no file is present
- Returns:
numpy array of dtype type