def get_process_data(indexes, processes):
    """Extract and label the process data from the ps command output.

    Args:
        indexes: dictionary with the indexes of the PID, PPID, and COMMAND headings in the column header
        processes: array of the currently-running processes

    Returns:
        process_data: array of dictionarys where each dict has the process data for the PID, PPID, and COMMAND headings

    """

    process_data = []
    maxsplit = indexes['command']

    for process in processes:
        process = process.rstrip()
        process_values = process.split(None, maxsplit)
        if len(process_values) <= 2:
            continue

        pid = process_values[indexes['pid']]
        ppid = process_values[indexes['ppid']]
        command = process_values[indexes['command']]

        process_data.append({'pid': pid, 'ppid': ppid, 'command': command})

    return process_data