diff --git a/pandas/core/frame.py b/pandas/core/frame.py index c7585b21abe99..3e8cc43562a2e 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -63,6 +63,7 @@ IndexLabel, Level, Manager, + NpDtype, PythonFuncType, Renamer, StorageOptions, @@ -1325,7 +1326,9 @@ def __rmatmul__(self, other): # IO methods (to / from other formats) @classmethod - def from_dict(cls, data, orient="columns", dtype=None, columns=None) -> DataFrame: + def from_dict( + cls, data, orient="columns", dtype: Optional[Dtype] = None, columns=None + ) -> DataFrame: """ Construct DataFrame from dict of array-like or dicts. @@ -1404,7 +1407,10 @@ def from_dict(cls, data, orient="columns", dtype=None, columns=None) -> DataFram return cls(data, index=index, columns=columns, dtype=dtype) def to_numpy( - self, dtype=None, copy: bool = False, na_value=lib.no_default + self, + dtype: Optional[NpDtype] = None, + copy: bool = False, + na_value=lib.no_default, ) -> np.ndarray: """ Convert the DataFrame to a NumPy array.