You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/source/io.rst
+15-15
Original file line number
Diff line number
Diff line change
@@ -952,9 +952,9 @@ Writing JSON
952
952
A ``Series`` or ``DataFrame`` can be converted to a valid JSON string. Use ``to_json``
953
953
with optional parameters:
954
954
955
-
- path_or_buf : the pathname or buffer to write the output
955
+
- ``path_or_buf`` : the pathname or buffer to write the output
956
956
This can be ``None`` in which case a JSON string is returned
957
-
- orient :
957
+
- ``orient`` :
958
958
959
959
Series :
960
960
default is 'index', allowed values are: {'split','records','index'}
@@ -970,9 +970,9 @@ with optional parameters:
970
970
* columns : dict like {column -> {index -> value}}
971
971
* values : just the values array
972
972
973
-
- date_format : type of date conversion (epoch = epoch milliseconds, iso = ISO8601), default is epoch
974
-
- double_precision : The number of decimal places to use when encoding floating point values, default 10.
975
-
- force_ascii : force encoded string to be ASCII, default True.
973
+
- ``date_format`` : type of date conversion (epoch = epoch milliseconds, iso = ISO8601), default is epoch
974
+
- ``double_precision`` : The number of decimal places to use when encoding floating point values, default 10.
975
+
- ``force_ascii`` : force encoded string to be ASCII, default True.
976
976
977
977
Note NaN's and None will be converted to null and datetime objects will be converted based on the date_format parameter
978
978
@@ -1010,12 +1010,12 @@ Reading a JSON string to pandas object can take a number of parameters.
1010
1010
The parser will try to parse a ``DataFrame`` if ``typ`` is not supplied or
1011
1011
is ``None``. To explicity force ``Series`` parsing, pass ``typ=series``
1012
1012
1013
-
- filepath_or_buffer : a **VALID** JSON string or file handle / StringIO. The string could be
1013
+
- ``filepath_or_buffer`` : a **VALID** JSON string or file handle / StringIO. The string could be
1014
1014
a URL. Valid URL schemes include http, ftp, s3, and file. For file URLs, a host
1015
1015
is expected. For instance, a local file could be
1016
1016
file ://localhost/path/to/table.json
1017
-
- typ : type of object to recover (series or frame), default 'frame'
1018
-
- orient :
1017
+
- ``typ`` : type of object to recover (series or frame), default 'frame'
1018
+
- ``orient`` :
1019
1019
1020
1020
Series :
1021
1021
default is 'index', allowed values are: {'split','records','index'}
@@ -1031,11 +1031,11 @@ is ``None``. To explicity force ``Series`` parsing, pass ``typ=series``
1031
1031
* columns : dict like {column -> {index -> value}}
1032
1032
* values : just the values array
1033
1033
1034
-
- dtype : if True, infer dtypes, if a dict of column to dtype, then use those, if False, then don't infer dtypes at all, default is True, apply only to the data
1035
-
- convert_axes : boolean, try to convert the axes to the proper dtypes, default is True
1036
-
- convert_dates : a list of columns to parse for dates; If True, then try to parse datelike columns, default is True
1037
-
- keep_default_dates : boolean, default True. If parsing dates, then parse the default datelike columns
1038
-
- numpy: direct decoding to numpy arrays. default is False;
1034
+
- ``dtype`` : if True, infer dtypes, if a dict of column to dtype, then use those, if False, then don't infer dtypes at all, default is True, apply only to the data
1035
+
- ``convert_axes`` : boolean, try to convert the axes to the proper dtypes, default is True
1036
+
- ``convert_dates`` : a list of columns to parse for dates; If True, then try to parse datelike columns, default is True
1037
+
- ``keep_default_dates`` : boolean, default True. If parsing dates, then parse the default datelike columns
1038
+
- ``numpy`` : direct decoding to numpy arrays. default is False;
1039
1039
Note that the JSON ordering **MUST** be the same for each term if ``numpy=True``
1040
1040
1041
1041
The parser will raise one of ``ValueError/TypeError/AssertionError`` if the JSON is
@@ -1049,8 +1049,8 @@ be set to ``False`` if you need to preserve string-like numbers (e.g. '1', '2')
1049
1049
1050
1050
When reading JSON data, automatic coercing into dtypes has some quirks:
1051
1051
1052
-
* an index can be in a different order, that is the returned order is not guaranteed to be the same as before serialization
1053
-
* a column that was ``float`` data can safely be converted to ``integer``, e.g. a column of ``1.``
1052
+
* an index can be reconstructed in a different order from serialization, that is, the returned order is not guaranteed to be the same as before serialization
1053
+
* a column that was ``float`` data will be converted to ``integer`` if it can be done safely, e.g. a column of ``1.``
1054
1054
* bool columns will be converted to ``integer`` on reconstruction
1055
1055
1056
1056
Thus there are times where you may want to specify specific dtypes via the ``dtype`` keyword argument.
0 commit comments