8000 NumPyBackedExtensionArray by TomAugspurger · Pull Request #24227 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

NumPyBackedExtensionArray #24227

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

Merged
merged 16 commits into from
Dec 28, 2018
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
wip
  • Loading branch information
TomAugspurger committed Dec 28, 2018
commit 7e3ff59770104f15cc6f7240e76451fb1a20c6a3
20 changes: 19 additions & 1 deletion pandas/tests/arrays/test_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import pandas.util._test_decorators as td

import pandas as pd
from pandas.core.arrays import PandasArray
from pandas.arrays import PandasArray
from pandas.core.arrays.numpy_ import PandasDtype
import pandas.util.testing as tm


Expand Down Expand Up @@ -96,3 +97,20 @@ def test_series_constructor_with_astype():
result = pd.Series(PandasArray(ndarray), dtype="float64")
expected = pd.Series([1.0, 2.0, 3.0], dtype="float64")
tm.assert_series_equal(result, expected)


@pytest.mark.parametrize('dtype, expected', [
('bool', True),
('int', True),
('uint', True),
('float', True),
('complex', True),
('str', False),
('bytes', False),
('datetime64[ns]', False),
('object', False),
('void', False)
])
def test_is_numeric(dtype, expected):
dtype = PandasDtype(dtype)
assert dtype._is_numeric is expected
0