h2oai / h2oai/datatable

to_csr

Open
#2,824 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.9k
Forks
164
Avg merge
7h 31m
Merged PRs (30d)
1

Description

- The current datatable supports .to_numpy. .to_pandas to convert Frame into dense array, but seems not supports conversion into sparse array, e.g., scipy.sparse.csr_matrix

- We could convert to the sparse array with two steps but is slow for very large Frame.
```
data = dt.fread(rna_file)
subset = data[:, 1:].to_numpy()
output = scipy.sparse.csr_matrix(subset)
```

- Could Frame extend a function to convert to sparse array directly? Thanks in advance!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.