Hi,

that's expected

a range in Excel is a 2d array, even if it's only 1 column wide or 1 row deep.

You can use a custom type to convert a 2d array into a list (see the flatten function in the custom types example), or you can just convert it at the start of your function, or you could use one of the 1d numpy types numpy_row or numpy_column.

eg:

@xl_func("numpy_column x: string")

def my_func(x):

# x is a 1d numpy array

return str(x)

or:

@xl_func("float[] x: string")

def my_func(x):

# x is a 2d list of lists - flatten it to a 1d list

x = list(itertools.chain(*x))

return str(x)

I think it's better to be consistent and keep all excel ranges represented the same way in python by default (a list of lists) than to try and second guess what the user expects (e.g. what if you expected a 2d range but only had a single row of data?) and so that's why the behaviour is as it is.

Best regards,

Tony