def print_array_to_excel(array, first_cell, ws, axis=2):
    '\n    Print an np array to excel using openpyxl\n    :param array: np array\n    :param first_cell: first cell to start dumping values in\n    :param ws: worksheet reference. From openpyxl, ws=wb[sheetname]\n    :param axis: to determine if the array is a col vector (0), row vector (1), or 2d matrix (2)\n    '
    if isinstance(array, (list,)):
        array = np.array(array)
    shape = array.shape
    if (axis == 0):
        array.flatten()
        for i in range(shape[0]):
            j = 0
            ws.cell((i + first_cell[0]), (j + first_cell[1])).value = array[i]
    elif (axis == 1):
        array.flatten()
        for j in range(shape[0]):
            i = 0
            ws.cell((i + first_cell[0]), (j + first_cell[1])).value = array[j]
    elif (axis == 2):
        for i in range(shape[0]):
            for j in range(shape[1]):
                ws.cell((i + first_cell[0]), (j + first_cell[1])).value = array[(i, j)]
Print an np array to excel using openpyxl
:param array: np array
:param first_cell: first cell to start dumping values in
:param ws: worksheet reference. From openpyxl, ws=wb[sheetname]
:param axis: to determine if the array is a col vector (0), row vector (1), or 2d matrix (2)
def print_array_to_excel(array, first_cell, ws, axis=2):
    '\n    Print an np array to excel using openpyxl\n    :param array: np array\n    :param first_cell: first cell to start dumping values in\n    :param ws: worksheet reference. From openpyxl, ws=wb[sheetname]\n    :param axis: to determine if the array is a col vector (0), row vector (1), or 2d matrix (2)\n    '
    if isinstance(array, (list,)):
        array = np.array(array)
    shape = array.shape
    if (axis == 0):
        array.flatten()
        for i in range(shape[0]):
            j = 0
            ws.cell((i + first_cell[0]), (j + first_cell[1])).value = array[i]
    elif (axis == 1):
        array.flatten()
        for j in range(shape[0]):
            i = 0
            ws.cell((i + first_cell[0]), (j + first_cell[1])).value = array[j]
    elif (axis == 2):
        for i in range(shape[0]):
            for j in range(shape[1]):
                ws.cell((i + first_cell[0]), (j + first_cell[1])).value = array[(i, j)]