I am using sklearn to do machine learning works.Here are my two variables:
>>> matrix
<1397x9576 sparse matrix of type '<type 'numpy.float64'>'
with 44655 stored elements in Compressed Sparse Row format>
>>> type(density)
<type 'list'>
>>> len(density)
1397
matrix
is generated by TfidfVectorizer.fit_transform()
. I want to extend the variable matrix
by adding variable density
as a new column.Is there any way to achieve it?