We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e323274 commit 91dcd7aCopy full SHA for 91dcd7a
pandas/tests/test_series.py
@@ -5435,12 +5435,14 @@ def test_astype_str(self):
5435
5436
# GH9757
5437
ts = Series([Timestamp('2010-01-04 00:00:00')])
5438
- ts = ts.astype(str)
5439
- self.assertEqual(ts.dtype, np.object_)
+ s = ts.astype(str)
+ expected = Series([str(ts.values[0])])
5440
+ assert_series_equal(s, expected)
5441
5442
td = Series([Timedelta(1, unit='d')])
- td = td.astype(str)
5443
- self.assertEqual(td.dtype, np.object_)
+ s = td.astype(str)
5444
+ expected = Series([str(td.values[0])])
5445
5446
5447
def test_astype_unicode(self):
5448
0 commit comments