I have a pandas dataframe Object, containing a column with a bag of words representation of text stored as 29881x23947 sparse matrix of type ''. The column was processed by using sklearn and the fit_transform() function.
I now want to tranform this Colum into a 2D Tensor with the convert_to_tensor() function.
x_train_tensor = tf.convert_to_tensor(x_train)
Getting the error Message:
TypeError: Expected binary or unicode string
Which Format is required to Transform my Matrix into a Tensor?
Edit: printing out the type of the column it says:
<class 'scipy.sparse.csr.csr_matrix'>
Example of the dataframe as output:
0 (0, 6276)\t1\n (0, 8209)\t1\n (0, 14299)\t...
1 (0, 6276)\t1\n (0, 8209)\t1\n (0, 14299)\t...
2 (0, 6276)\t1\n (0, 8209)\t1\n (0, 14299)\t...
3 (0, 6276)\t1\n (0, 8209)\t1\n (0, 14299)\t...