'Create a new array to hold the data based on the current set
of fields, and store them in the *array* and member variable.
Any data in the existing array will be lost.
*nrows*, if provided, is the number of rows to allocate.'

def create_arrays(self, nrows=0, config=None):

    if (nrows is None):
        nrows = 0
    fields = self.fields
    if (len(fields) == 0):
        array = np.recarray((nrows,), dtype=u'O')
        mask = np.zeros((nrows,), dtype=u'b')
    else:
        Field.uniqify_names(fields)
        dtype = []
        for x in fields:
            if six.PY2:
                if (x._unique_name == x.ID):
                    id = x.ID.encode(u'utf-8')
                else:
                    id = (x._unique_name.encode(u'utf-8'), x.ID.encode(u'utf-8'))
            elif (x._unique_name == x.ID):
                id = x.ID
            else:
                id = (x._unique_name, x.ID)
            dtype.append((id, x.converter.format))
        array = np.recarray((nrows,), dtype=np.dtype(dtype))
        descr_mask = []
        for d in array.dtype.descr:
            new_type = (((d[1][1] == u'O') and u'O') or u'bool')
            if (len(d) == 2):
                descr_mask.append((d[0], new_type))
            elif (len(d) == 3):
                descr_mask.append((d[0], new_type, d[2]))
        mask = np.zeros((nrows,), dtype=descr_mask)
    self.array = ma.array(array, mask=mask)
