Skip to content

Conversation

@simonjayhawkins
Copy link
Member

No description provided.

@simonjayhawkins simonjayhawkins added the Typing type annotations, mypy/pyright type checking label Oct 29, 2021
@simonjayhawkins simonjayhawkins added this to the 1.4 milestone Oct 29, 2021
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

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

Copy link
Member

@jbrockmendel jbrockmendel left a comment

Choose a reason for hiding this comment

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

LGTM

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?

@jreback jreback merged commit 66a1e92 into pandas-dev:master Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Typing type annotations, mypy/pyright type checking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants