'Read from .txt file a sparse representation of matrix
I have a .txt file of the form:
0 1 10 100 130 140
1 2 12 67 190
1 3 101 788 900
where the first column represents sentiments and the rest of the columns represent the feature that is 1. How can I convert this sparse data into a full matrix with all the features as columns and 0/1 values?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
