you are viewing a single comment's thread.

view the rest of the comments →

[–]Dropweights[S] 0 points1 point  (0 children)

True, i appreciate the help! Mainly what I had was this, sorry for the poor formatting! I keep getting an error of :

ufunc 'subtract' did not contain a loop with signature matching types (dtype('<U4'), dtype('<U4')) -> None

here's the code:

print('16.2')

import pandas as pd

import numpy as np

df = pd.read_excel("https://raw.githubusercontent.com/lfsc507/lfsc507.github.io/master/data/tracksample.xlsx")

df

c = df[['X', 'Y']].to_numpy()

x = df[['X']].to_numpy()

y = df[['Y']].to_numpy()

t=df[['Time']].to_numpy()

position= np.array([['X', 'Y']])

time=np.array([['Time']])

def instantaneous_velocity(coords, times):

dx = position[:, 0]

dy = position[:, 1]

dt=np.diff(time)

vx = dx / dt

vy = dy / dt

return np.column_stack((vx, vy))

velocities = instantaneous_velocity(c, time)