docs: def write(self, data, **keys):
          """
          Write data into this HDU
  
          parameters
          ----------
          data: ndarray or list of ndarray
              A numerical python array.  Should be an ordinary array for image
              HDUs, should have fields for tables.  To write an ordinary array to
              a column in a table HDU, use write_column.  If data already exists
              in this HDU, it will be overwritten.  See the append(() method to
              append new rows to a table HDU.
          firstrow: integer, optional
              At which row you should begin writing to tables.  Be sure you know
              what you are doing!  For appending see the append() method.
              Default 0.
          columns: list, optional
              If data is a list of arrays, you must send columns as a list
              of names or column numbers
  
              You can also send names=
          names: list, optional
              same as columns=
          """
  
          slow = keys.get('slow', False)
  
          isrec = False
          if isinstance(data, (list, dict)):
              if isinstance(data, list):
                  data_list = data
                  columns_all = keys.get('columns', None)
                  if columns_all is None:
                      columns_all = keys.get('names', None)
                      if columns_all is None:
                          raise ValueError(
                              "you must send columns with a list of arrays")
  
              else:
                  columns_all = list(data.keys())
                  data_list = [data[n] for n in columns_all]
  
              colnums_all = [self._extract_colnum(c) for c in columns_all]
              names = [self.get_colname(c) for c in colnums_all]
  
              isobj = numpy.zeros(len(data_list), dtype=numpy.bool)
              for i in xrange(len(data_list)):
                  isobj[i] = is_object(data_list[i])
  
          else:
              if data.dtype.fields is None:
                  raise ValueError("You are writing to a table, so I expected "
                                   "an array with fields as input. If you want "
                                   "to write a simple array, you should use "
                                   "write_column to write to a single column, "
                                   "or instead write to an image hdu")
  
              if data.shape is ():
                  raise ValueError("cannot write data with shape ()")
  
              isrec = True
              names = data.dtype.names
              # only write object types (variable-length columns) after
              # writing the main table
              isobj = fields_are_object(data)
  
              data_list = []
              colnums_all = []
              for i, name in enumerate(names):
                  colnum = self._extract_colnum(name)
                  data_list.append(data[name])
                  colnums_all.append(colnum)
  
          if slow:
              for i, name in enumerate(names):
                  if not isobj[i]:
                      self.write_column(name, data_list[i], **keys)
          else:
  
              nonobj_colnums = []
              nonobj_arrays = []
              for i in xrange(len(data_list)):
                  if not isobj[i]:
                      nonobj_colnums.append(colnums_all[i])
                      if isrec:
                          # this still leaves possibility of f-order sub-arrays..
                          colref = array_to_native(data_list[i], inplace=False)
                      else:
                          colref = array_to_native_c(data_list[i], inplace=False)
  
                      if IS_PY3 and colref.dtype.char == 'U':
                          # for python3, we convert unicode to ascii
                          # this will error if the character is not in ascii
                          colref = colref.astype('S', copy=False)
  
                      nonobj_arrays.append(colref)
  
              for tcolnum, tdata in zip(nonobj_colnums, nonobj_arrays):
                  self._verify_column_data(tcolnum, tdata)
  
              if len(nonobj_arrays) > 0:
                  firstrow = keys.get('firstrow', 0)
                  self._FITS.write_columns(
                      self._ext+1, nonobj_colnums, nonobj_arrays,
                      firstrow=firstrow+1, write_bitcols=self.write_bitcols)
  
          # writing the object arrays always occurs the same way
          # need to make sure this works for array fields
          for i, name in enumerate(names):
              if isobj[i]:
                  self.write_var_column(name, data_list[i], **keys)
  
          self._update_info()