Skip to content

Commit 4fa4dcd

Browse files
author
Santhosh18
committed
Inferred dtype at the end of df.explode()
1 parent 03de609 commit 4fa4dcd

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pandas/core/frame.py

+1
Original file line numberDiff line numberDiff line change
@@ -7019,6 +7019,7 @@ def explode(
70197019
else:
70207020
result.index = self.index.take(result.index)
70217021
result = result.reindex(columns=self.columns, copy=False)
7022+
result = result.infer_objects()
70227023

70237024
return result
70247025

pandas/tests/series/methods/test_explode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
def test_basic():
99
s = pd.Series([[0, 1, 2], np.nan, [], (3, 4)], index=list("abcd"), name="foo")
10-
result = s.explode()
10+
result = s. explode()
1111
expected = pd.Series(
1212
[0, 1, 2, np.nan, np.nan, 3, 4], index=list("aaabcdd"), dtype=object, name="foo"
1313
)

0 commit comments

Comments
 (0)