6
6
from pandas .core .dtypes .dtypes import DatetimeTZDtype
7
7
8
8
import pandas as pd
9
- from pandas import DataFrame , Series , Timestamp , date_range , option_context
9
+ from pandas import DataFrame , Series , date_range , option_context
10
10
import pandas ._testing as tm
11
11
12
12
@@ -18,22 +18,6 @@ def _check_cast(df, v):
18
18
19
19
20
20
class TestDataFrameDataTypes :
21
- def test_concat_empty_dataframe_dtypes (self ):
22
- df = DataFrame (columns = list ("abc" ))
23
- df ["a" ] = df ["a" ].astype (np .bool_ )
24
- df ["b" ] = df ["b" ].astype (np .int32 )
25
- df ["c" ] = df ["c" ].astype (np .float64 )
26
-
27
- result = pd .concat ([df , df ])
28
- assert result ["a" ].dtype == np .bool_
29
- assert result ["b" ].dtype == np .int32
30
- assert result ["c" ].dtype == np .float64
31
-
32
- result = pd .concat ([df , df .astype (np .float64 )])
33
- assert result ["a" ].dtype == np .object_
34
- assert result ["b" ].dtype == np .float64
35
- assert result ["c" ].dtype == np .float64
36
-
37
21
def test_empty_frame_dtypes (self ):
38
22
empty_df = DataFrame ()
39
23
tm .assert_series_equal (empty_df .dtypes , Series (dtype = object ))
@@ -244,56 +228,3 @@ def test_str_to_small_float_conversion_type(self):
244
228
result .loc [result .index , "A" ] = [float (x ) for x in col_data ]
245
229
expected = DataFrame (col_data , columns = ["A" ], dtype = float )
246
230
tm .assert_frame_equal (result , expected )
247
-
248
-
249
- class TestDataFrameDatetimeWithTZ :
250
- def test_interleave (self , timezone_frame ):
251
-
252
- # interleave with object
253
- result = timezone_frame .assign (D = "foo" ).values
254
- expected = np .array (
255
- [
256
- [
257
- Timestamp ("2013-01-01 00:00:00" ),
258
- Timestamp ("2013-01-02 00:00:00" ),
259
- Timestamp ("2013-01-03 00:00:00" ),
260
- ],
261
- [
262
- Timestamp ("2013-01-01 00:00:00-0500" , tz = "US/Eastern" ),
263
- pd .NaT ,
264
- Timestamp ("2013-01-03 00:00:00-0500" , tz = "US/Eastern" ),
265
- ],
266
- [
267
- Timestamp ("2013-01-01 00:00:00+0100" , tz = "CET" ),
268
- pd .NaT ,
269
- Timestamp ("2013-01-03 00:00:00+0100" , tz = "CET" ),
270
- ],
271
- ["foo" , "foo" , "foo" ],
272
- ],
273
- dtype = object ,
274
- ).T
275
- tm .assert_numpy_array_equal (result , expected )
276
-
277
- # interleave with only datetime64[ns]
278
- result = timezone_frame .values
279
- expected = np .array (
280
- [
281
- [
282
- Timestamp ("2013-01-01 00:00:00" ),
283
- Timestamp ("2013-01-02 00:00:00" ),
284
- Timestamp ("2013-01-03 00:00:00" ),
285
- ],
286
- [
287
- Timestamp ("2013-01-01 00:00:00-0500" , tz = "US/Eastern" ),
288
- pd .NaT ,
289
- Timestamp ("2013-01-03 00:00:00-0500" , tz = "US/Eastern" ),
290
- ],
291
- [
292
- Timestamp ("2013-01-01 00:00:00+0100" , tz = "CET" ),
293
- pd .NaT ,
294
- Timestamp ("2013-01-03 00:00:00+0100" , tz = "CET" ),
295
- ],
296
- ],
297
- dtype = object ,
298
- ).T
299
- tm .assert_numpy_array_equal (result , expected )
0 commit comments