Skip to content

TYP: pandas/core/missing.py #38339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
830fa00
add type hints
arw2019 Dec 5, 2020
605dc3c
review: remove assert
arw2019 Dec 7, 2020
e77c940
merge master
arw2019 Dec 7, 2020
f2d5ec4
typo
arw2019 Dec 7, 2020
e83904f
add isna check
arw2019 Dec 7, 2020
71caeeb
better error msg when interp method not string
arw2019 Dec 7, 2020
8fbbd47
improve docstring
arw2019 Dec 7, 2020
4474ada
Merge branch 'master' of https://github.com/pandas-dev/pandas into ty…
arw2019 Dec 7, 2020
575c227
remove Optional
arw2019 Dec 7, 2020
b19896b
use Axis TypeVar
arw2019 Dec 7, 2020
5036ee1
more hints
arw2019 Dec 8, 2020
c0c4338
Merge branch 'master' of https://github.com/pandas-dev/pandas into ty…
arw2019 Dec 8, 2020
2a31823
review comments
arw2019 Dec 9, 2020
4fb893b
Merge branch 'master' of https://github.com/pandas-dev/pandas into ty…
arw2019 Dec 9, 2020
95a734b
Merge branch 'master' of https://github.com/pandas-dev/pandas into ty…
arw2019 Dec 10, 2020
4aeec70
review comment
arw2019 Dec 10, 2020
d67977d
review comment: values_to_mask
arw2019 Dec 10, 2020
24f418a
review comments: mask_missing/infer_dtype_from_array
arw2019 Dec 11, 2020
aeb0b82
typo
arw2019 Dec 11, 2020
25d0051
typo
arw2019 Dec 11, 2020
bbd25ed
review comment
arw2019 Dec 11, 2020
785d27c
Merge branch 'master' of https://github.com/pandas-dev/pandas into ty…
arw2019 Dec 11, 2020
c2d6467
Merge branch 'master' of https://github.com/pandas-dev/pandas into ty…
arw2019 Dec 14, 2020
b505de5
review comment
arw2019 Dec 14, 2020
e39c152
docstring fix
arw2019 Dec 14, 2020
cb82c9a
review comments
arw2019 Dec 14, 2020
65effed
Merge branch 'master' of https://github.com/pandas-dev/pandas into ty…
arw2019 Dec 15, 2020
2fa64bd
Merge branch 'master' of https://github.com/pandas-dev/pandas into ty…
arw2019 Jan 5, 2021
a54a02f
merge master
arw2019 Feb 21, 2021
315822c
TYP: infer_dtype_from_array
arw2019 Feb 21, 2021
df4b70a
minimize diff
arw2019 Feb 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions pandas/core/dtypes/cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@
ints_to_pytimedelta,
)
from pandas._libs.tslibs.timezones import tz_compare
from pandas._typing import AnyArrayLike, ArrayLike, Dtype, DtypeObj, Scalar
from pandas._typing import (
AnyArrayLike,
ArrayLike,
Dtype,
DtypeObj,
PandasScalar,
Scalar,
)
from pandas.util._validators import validate_bool_kwarg

from pandas.core.dtypes.common import (
Expand Down Expand Up @@ -815,8 +822,8 @@ def dict_compat(d: Dict[Scalar, Scalar]) -> Dict[Scalar, Scalar]:


def infer_dtype_from_array(
arr, pandas_dtype: bool = False
) -> Tuple[DtypeObj, ArrayLike]:
arr: "Union[ArrayLike, Series, PandasScalar]", pandas_dtype: bool = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for these just use AnyArrayLike

) -> "Tuple[DtypeObj, Union[ArrayLike, Series]]":
"""
Infer the dtype from an array.

Expand Down Expand Up @@ -864,7 +871,7 @@ def infer_dtype_from_array(
# don't force numpy coerce with nan's
inferred = lib.infer_dtype(arr, skipna=False)
if inferred in ["string", "bytes", "mixed", "mixed-integer"]:
return (np.dtype(np.object_), arr)
return np.dtype(np.object_), arr

arr = np.asarray(arr)
return arr.dtype, arr
Expand Down
Loading