1 Reply Latest reply on Oct 8, 2018 2:47 PM by Patrick A Van Der Hyde

    Tabpy Error

    luana otake

      I'm having problem using the Tabpy Server, when I test the code on juypter I don't receive an error message, but when I put this on Tableau and use the parameters to create a Script_STR I receive this error.

       

       

      this is the script:

       

       

       

      SCRIPT_STR("

      import numpy as np

      import pandas as pd

       

      df = pd.read_csv('.\ABC_04.csv', sep=';', encoding = 'ISO-8859-1')

      count= 0

      for index,row in df.iterrows():

          count += 1

          #print(count , clientes_a)

          if (count < _arg1):

              df.set_value(index, 'GRUPO', 'A')

          elif (count < _arg2+_arg3):

              df.set_value(index, 'GRUPO', 'B')

          elif (count > _arg2+_arg3) & (count < _arg4):

              df.set_value(index, 'GRUPO', 'C')

            

              df_grupo_a = df.loc[(df['GRUPO']=='A')]

              df_grupo_b = df.loc[(df['GRUPO']=='B')]

              df_grupo_c = df.loc[(df['GRUPO']=='C')]

       

       

      return df

      ",[Count client 0.1],[Count client 0.2],[Count client 0.7],[Count Client Total])