@@ -1903,7 +1903,7 @@ def test_concat_multiindex_dfs_with_deepcopy(self):
1903
1903
1904
1904
def test_concat_no_unnecessary_upcast (self ):
1905
1905
# GH 13247
1906
- for pdt in [pd .Series , pd .DataFrame , pd .Panel , pd . Panel4D ]:
1906
+ for pdt in [pd .Series , pd .DataFrame , pd .Panel ]:
1907
1907
dims = pdt ().ndim
1908
1908
for dt in np .sctypes ['float' ]:
1909
1909
dfs = [pdt (np .array ([1 ], dtype = dt , ndmin = dims )),
@@ -1934,28 +1934,30 @@ def test_concat_no_unnecessary_upcast(self):
1934
1934
objs .append (pdt (np .array ([1 ], dtype = np .float16 , ndmin = dims )))
1935
1935
self .assertTrue (pd .concat (objs ).values .dtype == np .float64 )
1936
1936
1937
-
1938
- @pytest .mark .parametrize ('pdt' , [Series , DataFrame , Panel ])
1939
- def test_concat_no_unnecessary_upcast_pytest (pdt ):
1940
- dims = pdt ().ndim
1941
- for dt in np .sctypes ['float' ]:
1942
- dfs = [pdt (np .array ([1 ], dtype = dt , ndmin = dims )),
1943
- pdt (np .array ([np .nan ], dtype = dt , ndmin = dims )),
1944
- pdt (np .array ([5 ], dtype = dt , ndmin = dims ))]
1945
- x = pd .concat (dfs )
1946
- assert x .values .dtype == dt
1947
-
1948
- objs = []
1949
- objs .append (pdt (np .array ([1 ], dtype = np .float32 , ndmin = dims )))
1950
- objs .append (pdt (np .array ([1 ], dtype = np .float16 , ndmin = dims )))
1951
- assert pd .concat (objs ).values .dtype == np .float32
1952
-
1953
- objs = []
1954
- objs .append (pdt (np .array ([1 ], dtype = np .int32 , ndmin = dims )))
1955
- objs .append (pdt (np .array ([1 ], dtype = np .int64 , ndmin = dims )))
1956
- assert pd .concat (objs ).values .dtype == np .int64
1957
-
1958
- objs = []
1959
- objs .append (pdt (np .array ([1 ], dtype = np .int32 , ndmin = dims )))
1960
- objs .append (pdt (np .array ([1 ], dtype = np .float16 , ndmin = dims )))
1961
- assert pd .concat (objs ).values .dtype == np .float64
1937
+ # @pytest.mark.parametrize('dtype', np.sctypes['float'])
1938
+ # def test_concat_no_unnecessary_upcast_pytest(dtype):
1939
+ # klass = [Series, DataFrame, Panel]
1940
+ # for pdt in klass:
1941
+ # dims = pdt().ndim
1942
+ # for dt in dtype:
1943
+ # dfs = [pdt(np.array([1], dtype=dt, ndmin=dims)),
1944
+ # pdt(np.array([np.nan], dtype=dt, ndmin=dims)),
1945
+ # pdt(np.array([5], dtype=dt, ndmin=dims))]
1946
+ # x = pd.concat(dfs)
1947
+ # assert x.values.dtype == dt
1948
+ #
1949
+ # objs = []
1950
+ # objs.append(pdt(np.array([1], dtype=np.float32, ndmin=dims)))
1951
+ # objs.append(pdt(np.array([1], dtype=np.float16, ndmin=dims)))
1952
+ # assert pd.concat(objs).values.dtype == np.float32
1953
+ #
1954
+ # objs = []
1955
+ # objs.append(pdt(np.array([1], dtype=np.int32, ndmin=dims)))
1956
+ # objs.append(pdt(np.array([1], dtype=np.int64, ndmin=dims)))
1957
+ # assert pd.concat(objs).values.dtype == np.int64
1958
+ #
1959
+ # # not sure what is the best answer here
1960
+ # objs = []
1961
+ # objs.append(pdt(np.array([1], dtype=np.int32, ndmin=dims)))
1962
+ # objs.append(pdt(np.array([1], dtype=np.float16, ndmin=dims)))
1963
+ # assert pd.concat(objs).values.dtype == np.float64
0 commit comments