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 6bcd303 commit 10fbdb9Copy full SHA for 10fbdb9
pandas/core/generic.py
@@ -2584,6 +2584,14 @@ def to_json(
2584
]
2585
}}
2586
"""
2587
+
2588
+ if orient == "table":
2589
+ if any(isinstance(col, (int, float)) for col in self.columns):
2590
+ raise ValueError(
2591
+ "Column names must be strings for JSON serialization with "
2592
+ "orient='table'."
2593
+ )
2594
2595
from pandas.io import json
2596
2597
if date_format is None and orient == "table":
0 commit comments