Skip to content

API: ExtensionDtype._is_numeric #22345

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 8 commits into from
Aug 20, 2018
Merged
Changes from 2 commits
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
14 changes: 13 additions & 1 deletion pandas/tests/frame/test_block_internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
import numpy as np

from pandas import (DataFrame, Series, Timestamp, date_range, compat,
option_context)
option_context, Categorical)
from pandas.core.arrays import IntegerArray, IntervalArray
from pandas.compat import StringIO
import pandas as pd

Expand Down Expand Up @@ -436,6 +437,17 @@ def test_get_numeric_data(self):
expected = df
assert_frame_equal(result, expected)

def test_get_numeric_data_extension_dtype(self):
# GH 22290
df = DataFrame({
'A': IntegerArray([-10, np.nan, 0, 10, 20, 30], dtype='Int64'),
'B': Categorical(list('abcabc')),
'C': IntegerArray([0, 1, 2, 3, np.nan, 5], dtype='UInt8'),
'D': IntervalArray.from_breaks(range(7))})
result = df._get_numeric_data()
expected = df.loc[:, ['A', 'C']]
assert_frame_equal(result, expected)

def test_convert_objects(self):

oops = self.mixed_frame.T.T
Expand Down