chilin0525 opened a new issue, #49278: URL: https://github.com/apache/arrow/issues/49278
### Describe the enhancement requested Follow-up from #49147 (comment: https://github.com/apache/arrow/pull/49147#issuecomment-3879302706). PR #49147 added class-level docstring examples for `SparseCOOTensor`, `SparseCSRMatrix`, `SparseCSCMatrix`, and `SparseCSFTensor`. Currently, all examples only demonstrate construction via `from_dense_numpy()`. As @rok suggested, it would be useful to also add examples for the non-dense constructors that build sparse tensors directly from sparse data structures. The following factory methods in `python/pyarrow/tensor.pxi` are missing docstring examples: **`SparseCOOTensor`** - `from_numpy(data, coords, shape, dim_names=None)` - `from_scipy(obj, dim_names=None)` - `from_pydata_sparse(obj, dim_names=None)` - `from_tensor(obj)` **`SparseCSRMatrix`** - `from_numpy(data, indptr, indices, shape, dim_names=None)` - `from_scipy(obj, dim_names=None)` - `from_tensor(obj)` **`SparseCSCMatrix`** - `from_numpy(data, indptr, indices, shape, dim_names=None)` - `from_scipy(obj, dim_names=None)` - `from_tensor(obj)` **`SparseCSFTensor`** - `from_numpy(data, indptr, indices, shape, axis_order=None, dim_names=None)` - `from_tensor(obj)` ### Component(s) Python -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
