Member since
07-12-2018
1
Post
2
Kudos Received
0
Solutions
07-12-2018
06:13 PM
2 Kudos
It looks like you are using a scalar pandas_udf type, which doesn't support returning structs currently. I believe the return type you want is an array of strings, which is supported, so this should work. Try this: @pandas_udf("array<string>")
def stringClassifier(x,y,z):
# return a pandas series of a list of strings, that is same length as input - for example
s = pd.Series([[u"a", u"b"]] * len(x))
return s If you are using Python 2, make sure your strings are in unicode otherwise they might get interpreted as bytes. Hope that helps!
... View more