Skip to content

Commit 285a2d4

Browse files
code sample for pandas-dev#46683
1 parent ac2b9ea commit 285a2d4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

bisect/46683.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# BUG: Segmentation fault when JSON serializing a PeriodIndex #46683
2+
3+
import faulthandler
4+
5+
import pandas as pd
6+
7+
faulthandler.enable()
8+
9+
print(pd.__version__)
10+
11+
s = pd.Series(["2022-04-06", "2022-04-07"])
12+
p = pd.PeriodIndex(s, freq="D")
13+
df = pd.DataFrame(index=p)
14+
result = df.to_json()
15+
print(result)

0 commit comments

Comments
 (0)