Skip to content

Commit 3349ea7

Browse files
committed
DOC: minor io.rst edits
1 parent 34b55ce commit 3349ea7

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

doc/source/io.rst

+15-15
Original file line numberDiff line numberDiff line change
@@ -952,9 +952,9 @@ Writing JSON
952952
A ``Series`` or ``DataFrame`` can be converted to a valid JSON string. Use ``to_json``
953953
with optional parameters:
954954

955-
- path_or_buf : the pathname or buffer to write the output
955+
- ``path_or_buf`` : the pathname or buffer to write the output
956956
This can be ``None`` in which case a JSON string is returned
957-
- orient :
957+
- ``orient`` :
958958

959959
Series :
960960
default is 'index', allowed values are: {'split','records','index'}
@@ -970,9 +970,9 @@ with optional parameters:
970970
* columns : dict like {column -> {index -> value}}
971971
* values : just the values array
972972

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.
976976

977977
Note NaN's and None will be converted to null and datetime objects will be converted based on the date_format parameter
978978

@@ -1010,12 +1010,12 @@ Reading a JSON string to pandas object can take a number of parameters.
10101010
The parser will try to parse a ``DataFrame`` if ``typ`` is not supplied or
10111011
is ``None``. To explicity force ``Series`` parsing, pass ``typ=series``
10121012

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
10141014
a URL. Valid URL schemes include http, ftp, s3, and file. For file URLs, a host
10151015
is expected. For instance, a local file could be
10161016
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`` :
10191019

10201020
Series :
10211021
default is 'index', allowed values are: {'split','records','index'}
@@ -1031,11 +1031,11 @@ is ``None``. To explicity force ``Series`` parsing, pass ``typ=series``
10311031
* columns : dict like {column -> {index -> value}}
10321032
* values : just the values array
10331033

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;
10391039
Note that the JSON ordering **MUST** be the same for each term if ``numpy=True``
10401040

10411041
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')
10491049

10501050
When reading JSON data, automatic coercing into dtypes has some quirks:
10511051

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.``
10541054
* bool columns will be converted to ``integer`` on reconstruction
10551055

10561056
Thus there are times where you may want to specify specific dtypes via the ``dtype`` keyword argument.

0 commit comments

Comments
 (0)