Creating a big matrix where every element is the same
@JamesKPolk gave me a working solution.
T = matrix(RDF, 6000, 6000, lambda i,j: 1/6000)
I'm trying to create a matrix of dimension nxn in Sage. But every element in the matrix has to be 1/n. The size of n is around 7000.
First I tried using creating a matrix of ones with the build in sagemethod, and then multiplying the matrix with 1/n. This is very slow and crashes my jupyter notebook kernel.
T  =matrix.ones(7000) * 1/n
A second thing I tried is creating all the elements by list comprehension.
T = matrix(RDF,[[1/l for x in range(l)] for row in range(l)])
This also seems to be something my pc can't handle.