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
from datetime import timedelta
from serial_data_handler_zxw import SplitTimeSerialData
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))
python setup.py sdist bdist_wheel twine upload dist/*
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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b0bbdcbbd303a53e83f1280974374d21133269888890b647c9c641b9e3df0d4 |
|
MD5 | 4ab5f5f6fb307a612f8915e9f2b06716 |
|
BLAKE2b-256 | d6c6dbea9e966619b31f7573a00de195a838d7b68c59b7156990cea7b94a5032 |
Close
Hashes for serial_data_handler_zxw-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97f7804887cc0d25a10d6dc4c0e8698938e9c65eab37e76663efe8cbc76d8ea2 |
|
MD5 | dcad2673aaee112ce84acfa4a4d15372 |
|
BLAKE2b-256 | 7a7e8283382f5de48d486fbfe4104e2380f3807016a5c5381cca26e225bd37e7 |