def arrays_to_mgr(arrays, arr_names, index, columns, dtype=None):
<EOL>if index is None:<EOL><INDENT>index = extract_index(arrays)<EOL><DEDENT>else:<EOL><INDENT>index = ensure_index(index)<EOL><DEDENT>arrays = _homogenize(arrays, index, dtype)<EOL>axes = [ensure_index(columns), index]<EOL>return create_block_manager_from_arrays(arrays, arr_names, axes)<EOL>
Segregate Series based on type and coerce into matrices.

Needs to handle a lot of exceptional cases.