def METHOD_NAME(spotfinder_results, keys):
  headers = ['Image#']
  headers.extend(keys)
  rows = [headers]
  for i in sorted(spotfinder_results.images.keys()):
    spotfinder_one_image = spotfinder_results.images[i]
    row = []
    row.append("%i" %i)
    for k in keys:
      value = spotfinder_one_image[k]
      try:
        as_float = float(value)
        as_int = int(value)
        if float(as_int) == as_float:
          row.append("%i" %as_int)
        else:
          row.append("%.2f" %as_float)
      except (ValueError, TypeError):
        row.append("%s" %value)
    rows.append(row)
  return rows