Skip to content

Commit

Permalink
WIP type for data
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhavhrt committed Jul 17, 2019
1 parent 691d1bb commit c54642f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions pandas/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,9 @@

# Type for index and columns of DataFrame
Axes = Iterable[Union[ABCIndexClass, Iterable[str]]]

# Type for data of DataFrame
Data = TypeVar("Data", ABCDataFrame, dict, np.ndarray)

FrameOrSeries = TypeVar("FrameOrSeries", ABCSeries, ABCDataFrame)
Scalar = Union[str, int, float]
4 changes: 2 additions & 2 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
)
from pandas.core.dtypes.missing import isna, notna

from pandas._typing import Axes, Dtype
from pandas._typing import Axes, Data, Dtype
from pandas.core import algorithms, common as com, nanops, ops
from pandas.core.accessor import CachedAccessor
from pandas.core.arrays import Categorical, ExtensionArray
Expand Down Expand Up @@ -391,7 +391,7 @@ def _constructor_expanddim(self):
# Constructors

def __init__(self,
data=None,
data: Optional[Data] = None,
index: Optional[Axes] = None,
columns: Optional[Axes] = None,
dtype: Optional[Dtype] = None,
Expand Down

0 comments on commit c54642f

Please sign in to comment.