Skip to main content

Hi, I need help with this ASAP, I've spent all day and looked stuff up but keep getting the same error.

I have a python script which works perfectly fine in python, and I've integrated TabPy etc. However, the same code is not working in Tableau and keeps outputting this same error. I've tried a few different things and have also gotten an error of "The result returned by the SCRIPT function is of unexpected type"

 

I've attached the script below (and the original python script as well is here):

 

import numpy as np  

def gs_calc(v,gr_ang,wind_v,wind_ang):

# v = flight airspeed

# gr_ang = ground track heading (0=N,90=E,180=S,270=W), ope but it's in radians

# wind_v = wind velocity

# wind_ang = wind angle (direction the wind is going, i.e. N->S is 180 deg) but also in radians

#RETURNS Ground Speed, in the same speed units as the other 2 velocities

    gr_unit = np.array([np.cos(gr_ang),np.sin(gr_ang)])

    wind = np.array([wind_v*np.cos(wind_ang),wind_v*np.sin(wind_ang)])

    dot_wind_gr = np.dot(wind,gr_unit)

    b = np.sqrt(sum((wind-dot_wind_gr*gr_unit)**2))

    gr_speed = np.sqrt(v**2 - b**2) + dot_wind_gr

    return gr_speed.tolist()

 

Help with TabPy - Tableau 4.2

 

Thank you!

답변 4개
  1. 2020년 4월 21일 오후 9:28

    Under ..\Logs\ directory.

     

    By the way on the 2nd line of your script, shouldn't it be "(" vs "[" after np.array

     

    np.array( not np.array[

0/9000