Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion partial/pandas/core/arrays/categorical.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class Categorical(ExtensionArray, PandasObject):
def ordered(self) -> Ordered: ...
@property
def dtype(self) -> CategoricalDtype: ...
def copy(self) -> Categorical: ...
def astype(self, dtype: Dtype, copy: bool = ...) -> ArrayLike: ...
def size(self) -> int: ...
def itemsize(self) -> int: ...
Expand Down
21 changes: 13 additions & 8 deletions partial/pandas/core/arrays/datetimes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ def tz_to_dtype(tz): ...

class DatetimeArray(dtl.DatetimeLikeArrayMixin, dtl.TimelikeOps, dtl.DatelikeOps):
__array_priority__: int = ...
def __init__(self, values, dtype = ..., freq = ..., copy: bool = ...) -> None: ...
def __init__(self, values, dtype=..., freq=..., copy: bool = ...) -> None: ...
# ignore in dtype() is from the pandas source
@property
def dtype(self) -> Union[np.dtype, DatetimeTZDtype]: ...
def dtype(self) -> Union[np.dtype, DatetimeTZDtype]: ... # type: ignore[override]
@property
def tz(self): ...
@tz.setter
Expand All @@ -19,16 +20,16 @@ class DatetimeArray(dtl.DatetimeLikeArrayMixin, dtl.TimelikeOps, dtl.DatelikeOps
@property
def is_normalized(self): ...
def __array__(self, dtype=...) -> np.ndarray: ...
def __iter__(self) : ...
def __iter__(self): ...
def astype(self, dtype, copy: bool = ...): ...
def tz_convert(self, tz): ...
def tz_localize(self, tz, ambiguous: str = ..., nonexistent: str = ...): ...
def to_pydatetime(self): ...
def normalize(self): ...
def to_period(self, freq = ...): ...
def to_period(self, freq=...): ...
def to_perioddelta(self, freq): ...
def month_name(self, locale = ...): ...
def day_name(self, locale = ...): ...
def month_name(self, locale=...): ...
def day_name(self, locale=...): ...
@property
def time(self): ...
@property
Expand Down Expand Up @@ -60,8 +61,12 @@ class DatetimeArray(dtl.DatetimeLikeArrayMixin, dtl.TimelikeOps, dtl.DatelikeOps
is_leap_year = ...
def to_julian_date(self): ...

def sequence_to_dt64ns(data, dtype = ..., copy: bool = ..., tz = ..., dayfirst: bool = ..., yearfirst: bool = ..., ambiguous: str = ...): ...
def objects_to_datetime64ns(data, dayfirst, yearfirst, utc: bool = ..., errors: str = ..., require_iso8601: bool = ..., allow_object: bool = ...): ...
def sequence_to_dt64ns(
data, dtype=..., copy: bool = ..., tz=..., dayfirst: bool = ..., yearfirst: bool = ..., ambiguous: str = ...
): ...
def objects_to_datetime64ns(
data, dayfirst, yearfirst, utc: bool = ..., errors: str = ..., require_iso8601: bool = ..., allow_object: bool = ...
): ...
def maybe_convert_dtype(data, copy): ...
def maybe_infer_tz(tz, inferred_tz): ...
def validate_tz_from_dtype(dtype, tz): ...
Empty file.
42 changes: 42 additions & 0 deletions partial/pandas/core/dtypes/api.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from pandas.core.dtypes.common import (
is_array_like as is_array_like,
is_bool as is_bool,
is_bool_dtype as is_bool_dtype,
is_categorical as is_categorical,
is_categorical_dtype as is_categorical_dtype,
is_complex as is_complex,
is_complex_dtype as is_complex_dtype,
is_datetime64_any_dtype as is_datetime64_any_dtype,
is_datetime64_dtype as is_datetime64_dtype,
is_datetime64_ns_dtype as is_datetime64_ns_dtype,
is_datetime64tz_dtype as is_datetime64tz_dtype,
is_dict_like as is_dict_like,
is_dtype_equal as is_dtype_equal,
is_extension_array_dtype as is_extension_array_dtype,
is_extension_type as is_extension_type,
is_file_like as is_file_like,
is_float as is_float,
is_float_dtype as is_float_dtype,
is_hashable as is_hashable,
is_int64_dtype as is_int64_dtype,
is_integer as is_integer,
is_integer_dtype as is_integer_dtype,
is_interval as is_interval,
is_interval_dtype as is_interval_dtype,
is_iterator as is_iterator,
is_list_like as is_list_like,
is_named_tuple as is_named_tuple,
is_number as is_number,
is_numeric_dtype as is_numeric_dtype,
is_object_dtype as is_object_dtype,
is_period_dtype as is_period_dtype,
is_re as is_re,
is_re_compilable as is_re_compilable,
is_scalar as is_scalar,
is_signed_integer_dtype as is_signed_integer_dtype,
is_sparse as is_sparse,
is_string_dtype as is_string_dtype,
is_timedelta64_dtype as is_timedelta64_dtype,
is_timedelta64_ns_dtype as is_timedelta64_ns_dtype,
is_unsigned_integer_dtype as is_unsigned_integer_dtype,
pandas_dtype as pandas_dtype)
23 changes: 23 additions & 0 deletions partial/pandas/core/dtypes/base.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from typing import List, Optional, Type
from pandas._typing import ExtensionArray

class ExtensionDtype:
def __eq__(self, other) -> bool: ...
def __hash__(self) -> int: ...
def __ne__(self, other) -> bool: ...
@property
def na_value(self): ...
@property
def type(self) -> Type: ...
@property
def kind(self) -> str: ...
@property
def name(self) -> str: ...
@property
def names(self) -> Optional[List[str]]: ...
@classmethod
def construct_array_type(cls) -> Type[ExtensionArray]: ...
@classmethod
def construct_from_string(cls, string: str): ...
@classmethod
def is_dtype(cls, dtype) -> bool: ...
30 changes: 30 additions & 0 deletions partial/pandas/core/dtypes/cast.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import numpy as np
from pandas._typing import Dtype as Dtype

def maybe_convert_platform(values): ...
def is_nested_object(obj) -> bool: ...
def maybe_downcast_to_dtype(result, dtype): ...
def maybe_downcast_numeric(result, dtype, do_round: bool=...) : ...
def maybe_upcast_putmask(result: np.ndarray, mask: np.ndarray, other) : ...
def maybe_promote(dtype, fill_value = ...): ...
def infer_dtype_from(val, pandas_dtype: bool=...) : ...
def infer_dtype_from_scalar(val, pandas_dtype: bool=...) : ...
def infer_dtype_from_array(arr, pandas_dtype: bool=...) : ...
def maybe_infer_dtype_type(element): ...
def maybe_upcast(values, fill_value=..., dtype=..., copy: bool=...) : ...
def invalidate_string_dtypes(dtype_set) -> None: ...
def coerce_indexer_dtype(indexer, categories): ...
def coerce_to_dtypes(result, dtypes): ...
def astype_nansafe(arr, dtype, copy: bool=..., skipna: bool=...) : ...
def maybe_convert_objects(values: np.ndarray, convert_numeric: bool=...) : ...
def soft_convert_objects(values: np.ndarray, datetime: bool=..., numeric: bool=..., timedelta: bool=..., coerce: bool=..., copy: bool=...) : ...
def convert_dtypes(input_array, convert_string: bool=..., convert_integer: bool=..., convert_boolean: bool=...) -> Dtype: ...
def maybe_castable(arr) -> bool: ...
def maybe_infer_to_datetimelike(value, convert_dates: bool=...) : ...
def maybe_cast_to_datetime(value, dtype, errors: str=...) : ...
def find_common_type(types): ...
def cast_scalar_to_array(shape, value, dtype = ...): ...
def construct_1d_arraylike_from_scalar(value, length: int, dtype) : ...
def construct_1d_object_array_from_listlike(values): ...
def construct_1d_ndarray_preserving_na(values, dtype=..., copy: bool=...) : ...
def maybe_cast_to_integer_array(arr, dtype, copy: bool=...) : ...
75 changes: 75 additions & 0 deletions partial/pandas/core/dtypes/common.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import numpy as np
from pandas._typing import ArrayLike as ArrayLike
from pandas.core.dtypes.inference import (
is_array_like as is_array_like,
is_bool as is_bool,
is_complex as is_complex,
is_dict_like as is_dict_like,
is_file_like as is_file_like,
is_float as is_float,
is_hashable as is_hashable,
is_integer as is_integer,
is_interval as is_interval,
is_iterator as is_iterator,
is_list_like as is_list_like,
is_named_tuple as is_named_tuple,
is_number as is_number,
is_re as is_re,
is_re_compilable as is_re_compilable,
is_scalar as is_scalar,
)
from typing import Callable, Union

ensure_float64 = ...
ensure_float32 = ...

def ensure_float(arr): ...

ensure_uint64 = ...
ensure_int64 = ...
ensure_int32 = ...
ensure_int16 = ...
ensure_int8 = ...
ensure_platform_int = ...
ensure_object = ...

def ensure_str(value) -> str: ...
def ensure_categorical(arr): ...
def ensure_python_int(value: Union[int, np.integer]) -> int: ...
def classes(*klasses) -> Callable: ...
def classes_and_not_datetimelike(*klasses) -> Callable: ...
def is_object_dtype(arr_or_dtype) -> bool: ...
def is_sparse(arr) -> bool: ...
def is_scipy_sparse(arr) -> bool: ...
def is_categorical(arr) -> bool: ...
def is_datetime64_dtype(arr_or_dtype) -> bool: ...
def is_datetime64tz_dtype(arr_or_dtype) -> bool: ...
def is_timedelta64_dtype(arr_or_dtype) -> bool: ...
def is_period_dtype(arr_or_dtype) -> bool: ...
def is_interval_dtype(arr_or_dtype) -> bool: ...
def is_categorical_dtype(arr_or_dtype) -> bool: ...
def is_string_dtype(arr_or_dtype) -> bool: ...
def is_period_arraylike(arr) -> bool: ...
def is_datetime_arraylike(arr) -> bool: ...
def is_dtype_equal(source, target) -> bool: ...
def is_any_int_dtype(arr_or_dtype) -> bool: ...
def is_integer_dtype(arr_or_dtype) -> bool: ...
def is_signed_integer_dtype(arr_or_dtype) -> bool: ...
def is_unsigned_integer_dtype(arr_or_dtype) -> bool: ...
def is_int64_dtype(arr_or_dtype) -> bool: ...
def is_datetime64_any_dtype(arr_or_dtype) -> bool: ...
def is_datetime64_ns_dtype(arr_or_dtype) -> bool: ...
def is_timedelta64_ns_dtype(arr_or_dtype) -> bool: ...
def is_datetime_or_timedelta_dtype(arr_or_dtype) -> bool: ...
def is_numeric_v_string_like(a, b): ...
def is_datetimelike_v_numeric(a, b): ...
def needs_i8_conversion(arr_or_dtype) -> bool: ...
def is_numeric_dtype(arr_or_dtype) -> bool: ...
def is_string_like_dtype(arr_or_dtype) -> bool: ...
def is_float_dtype(arr_or_dtype) -> bool: ...
def is_bool_dtype(arr_or_dtype) -> bool: ...
def is_extension_type(arr) -> bool: ...
def is_extension_array_dtype(arr_or_dtype) -> bool: ...
def is_complex_dtype(arr_or_dtype) -> bool: ...
def infer_dtype_from_object(dtype): ...
def pandas_dtype(dtype): ...
5 changes: 5 additions & 0 deletions partial/pandas/core/dtypes/concat.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def get_dtype_kinds(l): ...
def concat_compat(to_concat, axis: int=...) : ...
def concat_categorical(to_concat, axis: int=...) : ...
def union_categoricals(to_union, sort_categories: bool=..., ignore_order: bool=...) : ...
def concat_datetime(to_concat, axis: int = ..., typs = ...): ...
120 changes: 120 additions & 0 deletions partial/pandas/core/dtypes/dtypes.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
from pandas._typing import Ordered as Ordered
from .base import ExtensionDtype as ExtensionDtype
from pandas._libs.tslibs import NaT as NaT, Period as Period, Timestamp as Timestamp # , timezones as timezones
from pandas.core.indexes.base import Index
from typing import Any, Optional, Sequence, Tuple, Type, Union

_str = str

def register_extension_dtype(cls: Type[ExtensionDtype]) -> Type[ExtensionDtype]: ...

class Registry:
dtypes = ...
def __init__(self) -> None: ...
def register(self, dtype: Type[ExtensionDtype]) -> None: ...
def find(self, dtype: Union[Type[ExtensionDtype], str]) -> Optional[Type[ExtensionDtype]]: ...

registry = ...

class PandasExtensionDtype(ExtensionDtype):
subdtype = ...
str: Optional[_str] = ...
num: int = ...
shape: Tuple[int, ...] = ...
itemsize: int = ...
base = ...
isbuiltin: int = ...
isnative: int = ...
def __hash__(self) -> int: ...
@classmethod
def reset_cache(cls) -> None: ...

class CategoricalDtypeType(type): ...

class CategoricalDtype(PandasExtensionDtype, ExtensionDtype):
name: _str = ...
type: Type[CategoricalDtypeType] = ...
kind: _str = ...
str: _str = ...
base = ...
def __init__(self, categories: Optional[Sequence[Any]] = ..., ordered: Ordered = ...) -> None: ...
@classmethod
def construct_from_string(cls, string: _str) -> CategoricalDtype: ...
def __hash__(self) -> int: ...
def __eq__(self, other) -> bool: ...
@classmethod
def construct_array_type(cls): ...
@staticmethod
def validate_ordered(ordered: Ordered) -> None: ...
@staticmethod
def validate_categories(categories, fastpath: bool = ...): ...
def update_dtype(self, dtype: Union[_str, CategoricalDtype]) -> CategoricalDtype: ...
@property
def categories(self) -> Index: ...
@property
def ordered(self) -> Ordered: ...

class DatetimeTZDtype(PandasExtensionDtype):
type: Type[Timestamp] = ...
kind: _str = ...
str: _str = ...
num: int = ...
base = ...
na_value = ...
def __init__(self, unit: _str = ..., tz=...) -> None: ...
@property
def unit(self): ...
@property
def tz(self): ...
@classmethod
def construct_array_type(cls): ...
@classmethod
def construct_from_string(cls, string: _str): ...
@property
def name(self) -> _str: ...
def __hash__(self) -> int: ...
def __eq__(self, other) -> bool: ...

class PeriodDtype(PandasExtensionDtype):
type: Type[Period] = ...
kind: _str = ...
str: _str = ...
base = ...
num: int = ...
def __new__(cls, freq=...): ...
@property
def freq(self): ...
@classmethod
def construct_from_string(cls, string: _str): ...
@property
def name(self) -> _str: ...
@property
def na_value(self): ...
def __hash__(self) -> int: ...
def __eq__(self, other) -> bool: ...
@classmethod
def is_dtype(cls, dtype) -> bool: ...
@classmethod
def construct_array_type(cls): ...
def __from_arrow__(self, array): ...

class IntervalDtype(PandasExtensionDtype):
name: _str = ...
kind: _str = ...
str: _str = ...
base = ...
num: int = ...
def __new__(cls, subtype=...): ...
@property
def subtype(self): ...
@classmethod
def construct_array_type(cls): ...
@classmethod
def construct_from_string(cls, string: _str): ...
@property
def type(self): ...
def __hash__(self) -> int: ...
def __eq__(self, other) -> bool: ...
@classmethod
def is_dtype(cls, dtype) -> bool: ...
def __from_arrow__(self, array): ...
Loading