from IPython.display import Image Image(url='http://deltagap.org/wp-content/uploads/2014/10/traza-marcada.png') import pandas as pd %matplotlib inline velocidades = pd.DataFrame.from_csv('plot_data.csv') velocidades.head(6) velocidades.plot(figsize=(10,5), color=['blue','red'], legend=False) v11 = velocidades.Blue.ix[1300:1450] / 3.6 # de km/h a m/s v21 = velocidades.Red.ix[1300:1450] / 3.6 v12 = velocidades.Blue.ix[1450:1600] /3.6 v22 = velocidades.Red.ix[1450:1600] /3.6 v13 = velocidades.Blue.ix[1880:2030] /3.6 v23 = velocidades.Red.ix[1880:2030] /3.6 v14 = velocidades.Blue.ix[2150:2300] /3.6 v24 = velocidades.Red.ix[2150:2300] /3.6 from scipy.integrate import trapz velocidades.ix[1300:1450].plot(figsize=(10,5), color=['blue','red'], legend=False) dt1 = trapz((v11 - v21)/(v21*v11),dx=10) dt1 velocidades.ix[1450:1600].plot(figsize=(10,5), color=['blue','red'], legend=False) dt2 = trapz((v12 - v22)/(v22*v12),dx=10) dt2 velocidades.ix[1880:2030].plot(figsize=(10,5), color=['blue','red'], legend=False) dt3 = trapz((v13 - v23)/(v23*v13),dx=10) dt3 velocidades.ix[2150:2300].plot(figsize=(10,5), color=['blue','red'], legend=False) dt4 = trapz((v14 - v24)/(v24*v14),dx=10) dt4