array_1 = "tiledb://TileDB-Inc/array_1"
array_2 = "tiledb://TileDB-Inc/array_2"
def median(numpy_ordered_dictionary_list):
# When you have multiple arrays, the parameter
# we pass in is actually a list of ordered dictionaries.
# The list is in the order of the arrays you asked for.
np.median(numpy_ordered_dictionary[0]["a"] + numpy_ordered_dictionary[1]["a"])
# The following will create the list of array to take part
# in the multi-array UDF. Each has as input the array name,
# a multi-index for slicing and a list of attributes to subselect on.
array_list = tiledb.cloud.array.ArrayList()
array_list.add(array_1, [(1, 4), (1, 4)], ["a"])
array_list.add(array_2, [(1, 2), (1, 4)], ["a"])
tiledb.cloud.login(username="my_username", password="my_password")
# or tiledb.cloud.login(token="my_token")
# This will execute `median` using as input the result of the
# slicing and subselection for each of the arrays in `array_list`
res = tiledb.cloud.array.exec_multi_array_udf(median, array_list)
print("Median Multi-array UDF:\n{}\n".format(res))libr