Skip to content

Commit fc34131

Browse files
committed
Merge branch 'ea-is-numeric' of https://github.com/TomAugspurger/pandas into ea-is-numeric
2 parents a3fdc2a + 1d96d22 commit fc34131

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

pandas/tests/frame/test_block_internals.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
import numpy as np
1212

1313
from pandas import (DataFrame, Series, Timestamp, date_range, compat,
14-
option_context)
14+
option_context, Categorical)
15+
from pandas.core.arrays import IntegerArray, IntervalArray
1516
from pandas.compat import StringIO
1617
import pandas as pd
1718

@@ -436,6 +437,17 @@ def test_get_numeric_data(self):
436437
expected = df
437438
assert_frame_equal(result, expected)
438439

440+
def test_get_numeric_data_extension_dtype(self):
441+
# GH 22290
442+
df = DataFrame({
443+
'A': IntegerArray([-10, np.nan, 0, 10, 20, 30], dtype='Int64'),
444+
'B': Categorical(list('abcabc')),
445+
'C': IntegerArray([0, 1, 2, 3, np.nan, 5], dtype='UInt8'),
446+
'D': IntervalArray.from_breaks(range(7))})
447+
result = df._get_numeric_data()
448+
expected = df.loc[:, ['A', 'C']]
449+
assert_frame_equal(result, expected)
450+
439451
def test_convert_objects(self):
440452

441453
oops = self.mixed_frame.T.T

0 commit comments

Comments
 (0)