From 5d8eb8d8f30722add9560304a9da2a7e37e4a343 Mon Sep 17 00:00:00 2001 From: Anthony Milbourne <18662115+amilbourne@users.noreply.github.com> Date: Sun, 12 Jan 2020 22:28:24 +0000 Subject: [PATCH 1/2] DOC: Clarified documentation for convert_dates and use_default_dates parameters --- pandas/io/json/_json.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pandas/io/json/_json.py b/pandas/io/json/_json.py index 12ce5e4a62d24..dbc49ff984aad 100644 --- a/pandas/io/json/_json.py +++ b/pandas/io/json/_json.py @@ -439,8 +439,18 @@ def read_json( Not applicable for ``orient='table'``. convert_dates : bool or list of str, default True - List of columns to parse for dates. If True, then try to parse - datelike columns. A column label is datelike if + If True then default datelike columns may be converted. + If False, no dates will be converted. + If a list of column names, then those columns will be converted and + default datelike columns may also be converted + + When True or list then keep_default_dates determines whether default + datelike columns are converted. + + keep_default_dates : bool, default True + If parsing dates (convert_dates is not False), then try to parse the + default datelike columns. + A column label is datelike if * it ends with ``'_at'``, @@ -452,9 +462,6 @@ def read_json( * it is ``'date'``. - keep_default_dates : bool, default True - If parsing dates, then parse the default datelike columns. - numpy : bool, default False Direct decoding to numpy arrays. Supports numeric data only, but non-numeric column and index labels are supported. Note also that the From 32ae938dfe24612a4a5ea23dec08198c75bf8e39 Mon Sep 17 00:00:00 2001 From: Anthony Milbourne <18662115+amilbourne@users.noreply.github.com> Date: Mon, 13 Jan 2020 22:04:38 +0000 Subject: [PATCH 2/2] Reworded after feedback from WillAyd --- pandas/io/json/_json.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pandas/io/json/_json.py b/pandas/io/json/_json.py index dbc49ff984aad..ae6ae70cbac72 100644 --- a/pandas/io/json/_json.py +++ b/pandas/io/json/_json.py @@ -439,13 +439,12 @@ def read_json( Not applicable for ``orient='table'``. convert_dates : bool or list of str, default True - If True then default datelike columns may be converted. + If True then default datelike columns may be converted (depending on + keep_default_dates). If False, no dates will be converted. If a list of column names, then those columns will be converted and - default datelike columns may also be converted - - When True or list then keep_default_dates determines whether default - datelike columns are converted. + default datelike columns may also be converted (depending on + keep_default_dates). keep_default_dates : bool, default True If parsing dates (convert_dates is not False), then try to parse the