import random


def generate_random_data(nb_objs, nb_attrs):
    """
    Generates a matrix of random data.
    :param nb_attrs: the dimension of the data
    :type nb_attrs: int
    :return: a matrix with nb_objs rows and nb_attrs+1 columns.
    The 1st column is filled with line numbers (integers, from 1 to nb_objs).
    """
    data = []
    for i in range(nb_objs):
        line = [i + 1] + list(map(lambda x: random.random(), range(nb_attrs)))
        data.append(tuple(line))
    return data