def _zero_on_type_error(column_fn):
if not column_fn:<EOL><INDENT>return column_fn<EOL><DEDENT>if not callable(column_fn):<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>@functools.wraps(column_fn)<EOL>def wrapped(column):<EOL><INDENT>try:<EOL><INDENT>return column_fn(column)<EOL><DEDENT>except TypeError:<EOL><INDENT>if isinstance(column, np.ndarray):<EOL><INDENT>return column.dtype.type() <EOL><DEDENT>else:<EOL><INDENT>raise<EOL><DEDENT><DEDENT><DEDENT>return wrapped<EOL>
Wrap a function on an np.ndarray to return 0 on a type error.