【发布时间】:2020-11-23 11:13:13
【问题描述】:
我正在尝试从数组的中心提取点的选择。说中间的 20%(中心两侧各 10% 的点)。
我可以使用数组切片选择最终和初始 x% 的数据。还有一种方法可以在数组中的某个给定点(例如中间)找到它。
no_pts = round(len(data)*percent/100)
#change here to edit number of points
sample = pts[-no_pts:]
【问题讨论】:
标签: python arrays database slice