SimuBox.toolkits.function module¶
- SimuBox.toolkits.function.arange(start: int | float, end: int | float, step: int | float, accuracy: int = 6)¶
从start到end,以指定的step作为间隔生成数值序列。强制包含两个端点,同时默认保持六位小数精度。
- 参数:
start – 起始值
end – 终止值
step – 步长
accuracy – 保留的小数精度
- 返回:
np.ndarray
- SimuBox.toolkits.function.find_nearest_1d(array: Sequence[int | float] | Iterable[int | float] | ndarray, value: int | float) int ¶
寻找序列(array)中与指定值(value)最接近的数值的索引。
- 参数:
array – 任意向量
value – 任意数值
- 返回:
索引值(整型)
- SimuBox.toolkits.function.match_target(candidates: Sequence[Path | str], **kwargs)¶
按照指定的关键字匹配路径。
- 参数:
candidates – 等待匹配的对象。
kwargs –
- 返回:
匹配到的对象。
- SimuBox.toolkits.function.process_dataframe(data: DataFrame, operation: Operation)¶
对dataframe数据进行便捷的预处理。
- 参数:
data –
operation –
accuracy –
- 返回:
- SimuBox.toolkits.function.replace_target(path: Path | str, target: str | int | float, key: str = 'phase') Path | None ¶
替换路径中的信息。
- 参数:
path – 原路径。
target – 需要替换的值。
key – 值对应的名称。
- 返回:
替换值之后的路径。