Dear List,
I'm analyzing some data and would like to change the labels to an
existing SparseMatrix. e.g. in the example below. Is there a way I
can make the column labels be ["*ruby*", "organge", "*emerald*"]
without converting mat1 to list and back?
Is there a method in sparse.py I did not see, or a place to start
wrapping existing ones from either divisi or pysparse?
Let me know if this is not enough info. Many thanks!
>>> from csc import divisi2
>>> mat1 = divisi2.make_sparse([
... (2, "apple", "red"),
... (2, "orange", "orange"),
... (1, "apple", "green"),
... (1, "celery", "green"),
... ])
>>> print mat1
SparseMatrix (3 by 3)
red orange green
apple 2.000000 --- 1.000000
orange --- 2.000000 ---
celery --- --- 1.000000
Lexing