File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -2378,7 +2378,7 @@ def to_json(
23782378 Describing the data, where data component is like ``orient='records'``.
23792379
23802380 Note that If `orient='table'`, column names must be strings.
2381- Using numeric column names will raise a `ValueError`.
2381+ Using non string column names will raise a `ValueError`.
23822382
23832383 date_format : {{None, 'epoch', 'iso'}}
23842384 Type of date conversion. 'epoch' = epoch milliseconds,
@@ -2450,7 +2450,7 @@ def to_json(
24502450 schema.
24512451
24522452 When using ``orient='table'``, column names must be strings due to JSON
2453- requiring string keys. If column names are numeric (integers or floats) ,
2453+ requiring string keys. If column names are anything other than string ,
24542454 a `ValueError` will be raised.
24552455
24562456 Examples
@@ -2594,7 +2594,7 @@ def to_json(
25942594
25952595 if orient == "table" :
25962596 if hasattr (self , "columns" ) and any (
2597- isinstance (col , ( int , float ) ) for col in self .columns
2597+ not isinstance (col , str ) for col in self .columns
25982598 ):
25992599 raise ValueError (
26002600 "Column names must be strings for JSON serialization with "
You can’t perform that action at this time.
0 commit comments