I am using glmnet
in Python using rpy2. However, I am not sure how to return the row names of the matrix in Python. Following only returns the matrix but not the variable names.
model = glm.cv_glmnet(x=XW_1, y=Y_1, **{'penalty.factor': penalty_factor})
coefs = np.array(base.as_matrix(glm.coef_glmnet(model, s="lambda.min")))