Skip to content

GH-49302: [Python][Doc] Incorrect parameter descriptions in SparseCSCMatrix.from_numpy#49303

Open
chilin0525 wants to merge 1 commit intoapache:mainfrom
chilin0525:fix-SparseCSCMatrix-docstring
Open

GH-49302: [Python][Doc] Incorrect parameter descriptions in SparseCSCMatrix.from_numpy#49303
chilin0525 wants to merge 1 commit intoapache:mainfrom
chilin0525:fix-SparseCSCMatrix-docstring

Conversation

@chilin0525
Copy link
Contributor

@chilin0525 chilin0525 commented Feb 17, 2026

Rationale for this change

The docstring for SparseCSCMatrix.from_numpy in python/pyarrow/tensor.pxi has incorrect parameter descriptions:

def from_numpy(data, indptr, indices, shape, dim_names=None):
"""
Create arrow::SparseCSCMatrix from numpy.ndarrays
Parameters
----------
data : numpy.ndarray
Data used to populate the sparse matrix.
indptr : numpy.ndarray
Range of the rows,
The i-th row spans from `indptr[i]` to `indptr[i+1]` in the data.
indices : numpy.ndarray
Column indices of the corresponding non-zero values.
shape : tuple
Shape of the matrix.
dim_names : list, optional
Names of the dimensions.
"""

  • indptr is described as "Range of the rows" but should be "Range of the columns"
  • indices is described as "Column indices" but should be "Row indices"

What changes are included in this PR?

Fix parameter descriptions in SparseCSCMatrix.from_numpy in python/pyarrow/tensor.pxi:

  • indptr: "Range of the rows" → "Range of the columns"
  • indices: "Column indices" → "Row indices"

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

Signed-off-by: ChiLin Chiu <chilin.chiou@gmail.com>
@github-actions
Copy link

⚠️ GitHub issue #49302 has been automatically assigned in GitHub to PR creator.

@chilin0525 chilin0525 changed the title GH-49302: [Python][Docs] Incorrect parameter descriptions in SparseCSCMatrix.from_numpy GH-49302: [Python][Doc] Incorrect parameter descriptions in SparseCSCMatrix.from_numpy Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant