Skip to content

Commit 32c0f17

Browse files
authored
DataFrame constructor - fix index and columns argument (#20)
1 parent ca0f312 commit 32c0f17

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

tests/pandas/test_indexes.py

+1
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,6 @@ def test_column_contains() -> None:
6262

6363

6464
def test_difference_none() -> None:
65+
# https://github.com/pandas-dev/pandas-stubs/issues/17
6566
ind = pd.Index([1, 2, 3])
6667
id = ind.difference([1, None])

typings/pandas/_typing.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Label = Optional[Hashable]
8080
Level = Union[Hashable, int]
8181
Ordered = Optional[bool]
8282
JSONSerializable = Union[PythonScalar, List, Dict]
83-
Axes = Collection
83+
Axes = Union[AnyArrayLike, List, Dict, range, Sequence[str]]
8484
Renamer = Union[Mapping[Any, Label], Callable[[Any], Label]]
8585
T = TypeVar("T")
8686
FuncType = Callable[..., Any]

typings/pandas/core/frame.pyi

+2-4
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ from typing import (
6565
Pattern,
6666
)
6767

68-
69-
7068
import numpy as _np
7169
import datetime as _dt
7270

@@ -178,8 +176,8 @@ class DataFrame(NDFrame, OpsMixin):
178176
def __new__(
179177
cls,
180178
data: Optional[Union[_ListLike, DataFrame, Dict[Any, Any]]] = ...,
181-
index: Optional[Union[Index, _ListLike]] = ...,
182-
columns: Optional[_ListLike] = ...,
179+
index: Optional[Axes] = ...,
180+
columns: Optional[Axes] = ...,
183181
dtype=...,
184182
copy: _bool = ...,
185183
) -> DataFrame: ...

0 commit comments

Comments
 (0)