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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25719b7beb9bbd367c647491d725bdebebaf5d3b59790ea832e8ba2a804b3f2e |
|
MD5 | 010b7e86447f225b32674f97da5f9971 |
|
BLAKE2b-256 | 18406553b9a2bf41abd72e330278d5eed5b5d194944c7e91f2e596828abb2417 |
Close
Hashes for serial_data_handler_zxw-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f514afa30bec0c549c1ba91cd1381d06759552f2ea761ffc87f31b92656edad |
|
MD5 | ee3946b5ac12405e60a4d43a2b117fdb |
|
BLAKE2b-256 | 195103481c9b0c2ec59d6eb66cfa23944648de60904de53cbedfdd425e7f5469 |