<jupyter_start><jupyter_text>Loading Kinoeva DataLoading and parsing text data exported from KinoveaThis is the data that is exported as text format.  For example:```Kinovea Trajectory data exportT X Y0:00:00:00 0.00 0.00 0:00:00:03 1.00 9.00 0:00:00:06 2.00 20.00 0:00:00:10 3.00 34.00 0:00:00:13 5.00 48.00 0:00:00:16 6.00 66.00 0:00:00:20 8.00 84.00 0:00:00:23 8.00 104.00 0:00:00:26 7.00 125.00 0:00:00:30 6.00 145.00 0:00:00:33 7.00 164.00 0:00:00:36 9.00 182.00 0:00:00:40 20.00 201.00 ```<jupyter_code>import pandas as pd
df = pd.read_csv('data/2/CFF Demo_ Underhand Vertical Med Ball Throw.txt', delim_whitespace=True,
                 index_col=0)
df.head()
# drop last column
df.drop(columns=['export'], inplace=True)
df.head()
# replace column names
df.columns = ['X', 'Y']
df.head()
# remove first row
df.drop(['#T'], inplace=True)
df.head()
# rename index
df.index.name = 'T'
df.head()
# save the original timestamp as another column
df['Original_timestamp'] = df.index

# time units are in h:mm:ss:hundredth
df.index = pd.to_timedelta(df.index.str.replace(r'(0:.*):(\d+)', r'0\1.\2'), errors='coerce')
df.head()
# If you want to convert to dates (non-offset)
# https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Period.strftime.html
#
# df.index = pd.to_datetime(df.index, format='0:%H:%M:%S', errors='coerce')
# pd.to_datetime(df.index, format='0:%H:%M:%S', errors='coerce')
# convert to numeric
df = df.apply(pd.to_numeric, errors='coerce', axis=1)
df.info()
# The above is quite a bit of code, so maybe easier to organize in 
# a function for reusability.  See utils.py
from utils import read_kinoeva
df = read_kinoeva('data/2/CFF Demo_ Underhand Vertical Med Ball Throw.txt')

print(df.info())
df.head()<jupyter_output><class 'pandas.core.frame.DataFrame'>
TimedeltaIndex: 160 entries, 00:00:00 to 00:00:05.300000
Data columns (total 3 columns):
X                     160 non-null float64
Y                     160 non-null float64
Original_timestamp    160 non-null object
dtypes: float64(2), object(1)
memory usage: 5.0+ KB
None
{'fraction_non_alphanumeric': 0.15414444983034417, 'fraction_numerical': 0.11536597188560349, 'mean_word_length': 4.305912596401028, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '246979', 'license': 'MIT', 'n_tokens_mistral': 953, 'n_tokens_neox': 788, 'n_words': 212, 'path': '01_load_data.ipynb', 'repo_name': 'lisaong/hss', 'size': '2063'}