File tree 2 files changed +3
-2
lines changed
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,7 @@ Other Enhancements
121
121
- :class:`IntervalIndex` has gained the :meth:`~IntervalIndex.set_closed` method to change the existing ``closed`` value (:issue:`21670`)
122
122
- :func:`~DataFrame.to_csv` and :func:`~DataFrame.to_json` now support ``compression='infer'`` to infer compression based on filename (:issue:`15008`)
123
123
- :func:`to_timedelta` now supports iso-formated timedelta strings (:issue:`21877`)
124
+ - :func:`read_json` now parse timedelta with `orient='table'` (:issue:`21140`)
124
125
-
125
126
126
127
.. _whatsnew_0240.api_breaking:
Original file line number Diff line number Diff line change 6
6
import warnings
7
7
8
8
import pandas ._libs .json as json
9
- from pandas import DataFrame , Timedelta
9
+ from pandas import DataFrame , to_timedelta
10
10
from pandas .api .types import CategoricalDtype
11
11
import pandas .core .common as com
12
12
from pandas .core .dtypes .common import (
@@ -308,7 +308,7 @@ def parse_table_schema(json, precise_float):
308
308
309
309
for col , dtype in dtypes .items ():
310
310
if dtype == 'timedelta64[ns]' :
311
- df [col ] = df [col ]. apply ( Timedelta )
311
+ df [col ] = to_timedelta ( df [col ])
312
312
313
313
df = df .astype (dtypes )
314
314
You can’t perform that action at this time.
0 commit comments