ensure_array

legwork.utils.ensure_array(*args)[source]

Convert arguments to numpy arrays

Convert arguments based on the following rules

  • Ignore any None values

  • Convert any lists to numpy arrays

  • Wrap any other types in lists and convert to numpy arrays

Parameters
argsany

Supply any number of arguments of any type

Returns
array_argsany

Args converted to numpy arrays

any_not_arraysbool

Whether any arg is not a list or None or a numpy array