Skip to content

Commit

Permalink
move types for 'data' in from 'pandas._typing'
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhavhrt committed Jul 24, 2019
1 parent c54642f commit 9f72713
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions pandas/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,5 @@
# 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]
7 changes: 4 additions & 3 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import itertools
import sys
from textwrap import dedent
from typing import FrozenSet, List, Optional, Set, Tuple, Type, Union
from typing import Any, FrozenSet, Iterable, List, Optional, Set, Tuple, Type, Union
import warnings

import numpy as np
Expand Down Expand Up @@ -80,7 +80,7 @@
)
from pandas.core.dtypes.missing import isna, notna

from pandas._typing import Axes, Data, Dtype
from pandas._typing import Axes, 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,8 @@ def _constructor_expanddim(self):
# Constructors

def __init__(self,
data: Optional[Data] = None,
data: Optional[Union[np.ndarray, dict,
'DataFrame']] = None,
index: Optional[Axes] = None,
columns: Optional[Axes] = None,
dtype: Optional[Dtype] = None,
Expand Down

0 comments on commit 9f72713

Please sign in to comment.