1 Reply Latest reply on Jun 14, 2017 9:02 PM by Zhouyi Zhang

    Tabpy

    Heidi Tehrani

      I am using the below query and it gives me an error "expected string or buffer"

       

       

      SCRIPT_STR("

      import re

      keywords = ['310-loan',

                  '310 loan',

                  'A1 FINANCING']

       

       

      if any([re.compile(r'\b%s\b' %keyword, re.IGNORECASE).search(_arg1) for keyword in keywords]):

          return 'Yes'

      else:

          return 'No'",

      ATTR([creditor])

      )

       

      Could anyone please guide me what causes this error?

       

      Thanks

        • 1. Re: Tabpy
          Zhouyi Zhang

          Hi, Heidi

           

          Try this:

           

          SCRIPT_STR("

          import re

          keywords = ['310-loan',

                      '310 loan',

                      'A1 FINANCING']

           

           

          if any([re.compile(r'\b%s\b' %keyword, re.IGNORECASE).search(_arg1[0]) for keyword in keywords]):

              return 'Yes'

          else:

              return 'No'",

          ATTR([creditor])

          )

           

          I test with superstore data

           

          Hope this could help, and let me know if you have any question

           

          ZZ