'Return a new copy of the table in the form of a structured np.ndarray or
np.ma.MaskedArray object (as appropriate).
Parameters
keep_byteorder : bool, optional
By default the returned array has all columns in native byte
order.  However, if this option is `True` this preserves the
byte order of all columns (if any are non-native).
Returns
table_array : np.ndarray (unmasked) or np.ma.MaskedArray (masked)
Copy of table as a numpy structured array'

def as_array(self, keep_byteorder=False):

    if (len(self.columns) == 0):
        return None
    sys_byteorder = (u'>', u'<')[(sys.byteorder == u'little')]
    native_order = (u'=', sys_byteorder)
    dtype = []
    cols = self.columns.values()
    for col in cols:
        col_descr = descr(col)
        byteorder = col.info.dtype.byteorder
        if ((not keep_byteorder) and (byteorder not in native_order)):
            new_dt = np.dtype(col_descr[1]).newbyteorder(u'=')
            col_descr = (col_descr[0], new_dt, col_descr[2])
        dtype.append(col_descr)
    empty_init = (ma.empty if self.masked else np.empty)
    data = empty_init(len(self), dtype=dtype)
    for col in cols:
        data[col.info.name] = col
    return data
