A simple library to handle time gaps in data , especially in AI 人工智能中处理时间数据断层的工具包
Project description
process serial data for AI training
人工智能训练中,对于时间断层数据的处理工具包
- 根据断点,分配数据集,保证训练数据的连续性
- allocate data set according to breakpoints, to ensure the continuity of training data
code demo
# Attention:
# 传入的数据必须指定时间列(或其他顺序列)
# You must specify the time column (or other sequential column) of the incoming data
# 传入的数据必须已按顺序排列好
# The incoming data must be sorted in order
import pandas as pd
csv_path = "/Volumes/time_serial_data.csv"
data = pd.read_csv(csv_path)
# specific the time column named '收盘时间' ,
# and set the gap is 2 minutes ,
# it means that if the gap between two adjacent data > 2 minutes, it will be considered as a breakpoint
x = SplitTimeSerialData(data, column_timestamp='收盘时间', gap=timedelta(minutes=2))
print(x.断点)
train_test_data = x.数据划分_避开断点(input长度=100, output长度=100, step=1)
print(len(train_test_data))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for serial_data_handler_zxw-0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee84e36ae0486e83e85f818b490e01dbee862c056edd4dd37fbdd7835766e2b4 |
|
MD5 | fd2f91bd76185e5a0dd08318ce6ef516 |
|
BLAKE2b-256 | 8066ec55b9d816987da7d35651348cb5152579b60ea7f3eaef9a416e11b01d03 |
Close
Hashes for serial_data_handler_zxw-0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47598c4a75b989134d17b76bc766d470460c764a8e65ef1b42265b76cccd9800 |
|
MD5 | 9e9d7d6f7074164ac85601b7ed63210b |
|
BLAKE2b-256 | 5b8a3fb6927a2420f81368f19daa5eed6a70305e92c6a6653c2a47695204b156 |