18 lines
528 B
Python
18 lines
528 B
Python
import numpy as np
|
|
import csv
|
|
import matplotlib.pyplot as plt
|
|
|
|
def import_csv_data(filename):
|
|
stylus_x = []
|
|
stylus_y = []
|
|
stylus_pressure = []
|
|
time = []
|
|
with open(filename) as csv_fp:
|
|
reader = csv.reader(csv_fp)
|
|
next(reader) # skip header
|
|
for row in reader:
|
|
for i, v in enumerate([stylus_x, stylus_y]): #, stylus_pressure, time]):
|
|
v.append(float(row[i]))
|
|
stylus_pos = np.array([stylus_x, stylus_y])
|
|
time = np.array(time)
|
|
return time, stylus_pos |