We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 04893a9 commit e623f0fCopy full SHA for e623f0f
pandas/tests/frame/test_apply.py
@@ -1346,3 +1346,17 @@ def test_frequency_is_original(self, num_cols):
1346
df = DataFrame(1, index=index, columns=range(num_cols))
1347
df.apply(lambda x: x)
1348
assert index.freq == original.freq
1349
+
1350
+ def test_apply_datetime_tz_issue(self):
1351
+ # GH 29052
1352
1353
+ timestamps = [
1354
+ pd.Timestamp("2019-03-15 12:34:31.909000+0000", tz="UTC"),
1355
+ pd.Timestamp("2019-03-15 12:34:34.359000+0000", tz="UTC"),
1356
+ pd.Timestamp("2019-03-15 12:34:34.660000+0000", tz="UTC"),
1357
+ ]
1358
+ df = DataFrame(data=[0, 1, 2], index=timestamps)
1359
+ result = df.apply(lambda x: x.name, axis=1)
1360
+ expected = pd.Series(index=timestamps, data=timestamps)
1361
1362
+ tm.assert_series_equal(result, expected)
0 commit comments