from collections.abc import Iterable
from typing import Any, TypeVar

import numpy as np
from numpy.typing import NDArray

from .utils import FloatArray, NumericArray

T = TypeVar("T", bound=NumericArray)
F = TypeVar("F", bound=FloatArray)

def allnan(arrays, /, *, axis: int | tuple[int, ...] | None = None): ...
def anynan(arrays, /, *, axis: int | tuple[int, ...] | None = None): ...
def nancount(arrays, /, *, axis: int | tuple[int, ...] | None = None): ...
def nansum(arrays, /, *, axis: int | tuple[int, ...] | None = None): ...
def nanmean(arrays, /, *, axis: int | tuple[int, ...] | None = None): ...
def nanvar(arrays, /, *, ddof: int, axis: int | tuple[int, ...] | None = None): ...
def nanstd(arrays, /, *, ddof: int, axis: int | tuple[int, ...] | None = None): ...
def nanargmax(arr: NDArray[Any], /, *, axis: tuple[int, ...] | int | None = None): ...
def nanargmin(arr: NDArray[Any], /, *, axis: tuple[int, ...] | int | None = None): ...
def nanmax(arr: NDArray[Any], /, *, axis: tuple[int, ...] | int | None = None): ...
def nanmin(arr: NDArray[Any], /, *, axis: tuple[int, ...] | int | None = None): ...
def nanquantile(
    a: NDArray[np.float64],
    quantiles: float | Iterable[float],
    axis: int | tuple[int, ...] | None = None,
    **kwargs,
) -> NDArray[np.float64]: ...
def nanmedian(
    a: NDArray[np.float64], axis: int | tuple[int, ...] | None = None, **kwargs
) -> NDArray[np.float64]: ...
def bfill(
    arr: F,
    limit: int | None = None,
    axis: int = -1,
) -> F: ...
def ffill(
    arr: F,
    limit: int | None = None,
    axis: int = -1,
) -> F: ...
def nancovmatrix(a: F, **kwargs): ...
def nancorrmatrix(a: F, **kwargs): ...

count = nancount
