def to_arrays(data, columns, coerce_float=False, dtype=None):
if isinstance(data, ABCDataFrame):<EOL><INDENT>if columns is not None:<EOL><INDENT>arrays = [data._ixs(i, axis=<NUM_LIT:1>).values<EOL>for i, col in enumerate(data.columns) if col in columns]<EOL><DEDENT>else:<EOL><INDENT>columns = data.columns<EOL>arrays = [data._ixs(i, axis=<NUM_LIT:1>).values for i in range(len(columns))]<EOL><DEDENT>return arrays, columns<EOL><DEDENT>if not len(data):<EOL><INDENT>if isinstance(data, np.ndarray):<EOL><INDENT>columns = data.dtype.names<EOL>if columns is not None:<EOL><INDENT>return [[]] * len(columns), columns<EOL><DEDENT><DEDENT>return [], []  <EOL><DEDENT>if isinstance(data[<NUM_LIT:0>], (list, tuple)):<EOL><INDENT>return _list_to_arrays(data, columns, coerce_float=coerce_float,<EOL>dtype=dtype)<EOL><DEDENT>elif isinstance(data[<NUM_LIT:0>], abc.Mapping):<EOL><INDENT>return _list_of_dict_to_arrays(data, columns,<EOL>coerce_float=coerce_float, dtype=dtype)<EOL><DEDENT>elif isinstance(data[<NUM_LIT:0>], ABCSeries):<EOL><INDENT>return _list_of_series_to_arrays(data, columns,<EOL>coerce_float=coerce_float,<EOL>dtype=dtype)<EOL><DEDENT>elif isinstance(data[<NUM_LIT:0>], Categorical):<EOL><INDENT>if columns is None:<EOL><INDENT>columns = ibase.default_index(len(data))<EOL><DEDENT>return data, columns<EOL><DEDENT>elif (isinstance(data, (np.ndarray, ABCSeries, Index)) and<EOL>data.dtype.names is not None):<EOL><INDENT>columns = list(data.dtype.names)<EOL>arrays = [data[k] for k in columns]<EOL>return arrays, columns<EOL><DEDENT>else:<EOL><INDENT>data = lmap(tuple, data)<EOL>return _list_to_arrays(data, columns, coerce_float=coerce_float,<EOL>dtype=dtype)<EOL><DEDENT>
Return list of arrays, columns.