Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions pandas/_libs/algos.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,14 @@ def kth_smallest(
# Pairwise correlation/covariance

def nancorr(
mat: np.ndarray, # const float64_t[:, :]
mat: npt.NDArray[np.float64], # const float64_t[:, :]
cov: bool = ...,
minp=...,
) -> np.ndarray: ... # ndarray[float64_t, ndim=2]
minp: int | None = ...,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may pass None from pandas/core/frame.py:9667. base_cov = libalgos.nancorr(mat, cov=True, minp=min_periods)

In nancorr_spearman we don't allow None, if not specified, the default is 1, specified in the function signature.

The default is also 1 in nancorr, coded if None which is the signature default.

Not sure whether this inconsistency is a big deal.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could open an issue about this

) -> npt.NDArray[np.float64]: ... # ndarray[float64_t, ndim=2]
def nancorr_spearman(
mat: np.ndarray, # ndarray[float64_t, ndim=2]
mat: npt.NDArray[np.float64], # ndarray[float64_t, ndim=2]
minp: int = ...,
) -> np.ndarray: ... # ndarray[float64_t, ndim=2]
def nancorr_kendall(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was removed in #43403

mat: np.ndarray, # ndarray[float64_t, ndim=2]
minp: int = ...,
) -> np.ndarray: ... # ndarray[float64_t, ndim=2]
) -> npt.NDArray[np.float64]: ... # ndarray[float64_t, ndim=2]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you heard anything about if/when/how npt.NDArray is going to support something equivalent to ndim=2?


# ----------------------------------------------------------------------

Expand Down