Skip to content

Commit cbcd762

Browse files
CLN: add typing to dtype arg in core/frame.py (GH38808) (#39458)
1 parent 71a4cb6 commit cbcd762

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pandas/core/frame.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
IndexLabel,
6464
Level,
6565
Manager,
66+
NpDtype,
6667
PythonFuncType,
6768
Renamer,
6869
StorageOptions,
@@ -1325,7 +1326,9 @@ def __rmatmul__(self, other):
13251326
# IO methods (to / from other formats)
13261327

13271328
@classmethod
1328-
def from_dict(cls, data, orient="columns", dtype=None, columns=None) -> DataFrame:
1329+
def from_dict(
1330+
cls, data, orient="columns", dtype: Optional[Dtype] = None, columns=None
1331+
) -> DataFrame:
13291332
"""
13301333
Construct DataFrame from dict of array-like or dicts.
13311334
@@ -1404,7 +1407,10 @@ def from_dict(cls, data, orient="columns", dtype=None, columns=None) -> DataFram
14041407
return cls(data, index=index, columns=columns, dtype=dtype)
14051408

14061409
def to_numpy(
1407-
self, dtype=None, copy: bool = False, na_value=lib.no_default
1410+
self,
1411+
dtype: Optional[NpDtype] = None,
1412+
copy: bool = False,
1413+
na_value=lib.no_default,
14081414
) -> np.ndarray:
14091415
"""
14101416
Convert the DataFrame to a NumPy array.

0 commit comments

Comments
 (0)