Skip to content

Commit

Permalink
add more functions/overloads to stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Jun 16, 2019
1 parent 4512ad7 commit 3e83ee6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
15 changes: 14 additions & 1 deletion stubs/numpy/numpy_core.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,17 @@ class ndarray(List):
@overload
def any(self, axis: int, **kwargs) -> ndarray: ...

def astype(self, ty, **kwargs) -> 'ndarray': ...
@overload
def astype(self, ty: Literal[str], **kwargs) -> 'ndarray[str]': ...

@overload
def astype(self, ty: Literal[int], **kwargs) -> 'ndarray[int]': ...

@overload
def astype(self, ty: Literal[float], **kwargs) -> 'ndarray[float]': ...

@overload
def astype(self, ty: Literal[bool], **kwargs) -> 'ndarray[bool]': ...

def reshape(self, shape: Tuple, **kwargs) -> 'ndarray': ...

Expand Down Expand Up @@ -199,3 +209,6 @@ def outer(*args, **kwargs) -> ndarray: ...


def size(*args, **kwargs) -> ndarray: ...


def where(*args, **kwargs) -> ndarray: ...
12 changes: 4 additions & 8 deletions stubs/pandas/pandas_core.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,11 @@ class DataFrame:

def apply(self, x: Callable, **kwargs) -> 'DataFrame': ...

@classmethod
def from_records(self, records: List[dict], **kwargs) -> 'DataFrame': ...

class Series:

# These are custom values
node_id: 'Series'
parent_id: 'Series'
relation: 'Series'

T: 'DataFrame'
class Series:

loc: 'SeriesLoc'
at: 'At'
Expand All @@ -251,7 +247,7 @@ class Series:
copy: bool = ...,
): ...

def __getitem__(self, idx) -> ndarray: ...
def __getitem__(self, idx) -> Any: ...

def __setitem__(self, idx, value) -> None: ...

Expand Down

0 comments on commit 3e83ee6

Please sign in to comment.