@@ -46,63 +46,33 @@ def test_concat_empty_dataframe_dtypes(self):
46
46
assert result ["b" ].dtype == np .float64
47
47
assert result ["c" ].dtype == np .float64
48
48
49
- def test_empty_frame_dtypes_ftypes (self ):
49
+ def test_empty_frame_dtypes (self ):
50
50
empty_df = pd .DataFrame ()
51
51
tm .assert_series_equal (empty_df .dtypes , pd .Series (dtype = np .object ))
52
52
53
- # GH 26705 - Assert .ftypes is deprecated
54
- with tm .assert_produces_warning (FutureWarning ):
55
- tm .assert_series_equal (empty_df .ftypes , pd .Series (dtype = np .object ))
56
-
57
53
nocols_df = pd .DataFrame (index = [1 , 2 , 3 ])
58
54
tm .assert_series_equal (nocols_df .dtypes , pd .Series (dtype = np .object ))
59
55
60
- # GH 26705 - Assert .ftypes is deprecated
61
- with tm .assert_produces_warning (FutureWarning ):
62
- tm .assert_series_equal (nocols_df .ftypes , pd .Series (dtype = np .object ))
63
-
64
56
norows_df = pd .DataFrame (columns = list ("abc" ))
65
57
tm .assert_series_equal (
66
58
norows_df .dtypes , pd .Series (np .object , index = list ("abc" ))
67
59
)
68
60
69
- # GH 26705 - Assert .ftypes is deprecated
70
- with tm .assert_produces_warning (FutureWarning ):
71
- tm .assert_series_equal (
72
- norows_df .ftypes , pd .Series ("object:dense" , index = list ("abc" ))
73
- )
74
-
75
61
norows_int_df = pd .DataFrame (columns = list ("abc" )).astype (np .int32 )
76
62
tm .assert_series_equal (
77
63
norows_int_df .dtypes , pd .Series (np .dtype ("int32" ), index = list ("abc" ))
78
64
)
79
- # GH 26705 - Assert .ftypes is deprecated
80
- with tm .assert_produces_warning (FutureWarning ):
81
- tm .assert_series_equal (
82
- norows_int_df .ftypes , pd .Series ("int32:dense" , index = list ("abc" ))
83
- )
84
65
85
66
odict = OrderedDict
86
67
df = pd .DataFrame (odict ([("a" , 1 ), ("b" , True ), ("c" , 1.0 )]), index = [1 , 2 , 3 ])
87
68
ex_dtypes = pd .Series (
88
69
odict ([("a" , np .int64 ), ("b" , np .bool ), ("c" , np .float64 )])
89
70
)
90
- ex_ftypes = pd .Series (
91
- odict ([("a" , "int64:dense" ), ("b" , "bool:dense" ), ("c" , "float64:dense" )])
92
- )
93
71
tm .assert_series_equal (df .dtypes , ex_dtypes )
94
72
95
- # GH 26705 - Assert .ftypes is deprecated
96
- with tm .assert_produces_warning (FutureWarning ):
97
- tm .assert_series_equal (df .ftypes , ex_ftypes )
98
-
99
73
# same but for empty slice of df
100
74
tm .assert_series_equal (df [:0 ].dtypes , ex_dtypes )
101
75
102
- # GH 26705 - Assert .ftypes is deprecated
103
- with tm .assert_produces_warning (FutureWarning ):
104
- tm .assert_series_equal (df [:0 ].ftypes , ex_ftypes )
105
-
106
76
def test_datetime_with_tz_dtypes (self ):
107
77
tzframe = DataFrame (
108
78
{
@@ -474,22 +444,6 @@ def test_dtypes_gh8722(self, float_string_frame):
474
444
result = df .dtypes
475
445
tm .assert_series_equal (result , Series ({0 : np .dtype ("int64" )}))
476
446
477
- def test_ftypes (self , mixed_float_frame ):
478
- frame = mixed_float_frame
479
- expected = Series (
480
- dict (
481
- A = "float32:dense" ,
482
- B = "float32:dense" ,
483
- C = "float16:dense" ,
484
- D = "float64:dense" ,
485
- )
486
- ).sort_values ()
487
-
488
- # GH 26705 - Assert .ftypes is deprecated
489
- with tm .assert_produces_warning (FutureWarning ):
490
- result = frame .ftypes .sort_values ()
491
- tm .assert_series_equal (result , expected )
492
-
493
447
def test_astype_float (self , float_frame ):
494
448
casted = float_frame .astype (int )
495
449
expected = DataFrame (
0 commit comments