Skip to content

Commit 3cf750b

Browse files
author
Harish Kesava Rao
committed
Incorporated changes from style suggestions
1 parent fd2a8f3 commit 3cf750b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

docs/scenarios/serialization.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Flat vs. Nested data
2121
********************
2222

2323
Before beginning to serialize data, it is important to identify or decide how the
24-
data needs to be structured during data serialization - flat or nested.
24+
data should to be structured during data serialization - flat or nested.
2525
The differences in the two styles are shown in the below examples.
2626

2727
Flat style:
@@ -42,7 +42,7 @@ Nested style:
4242
For more reading on the two styles, please see the discussion on
4343
`Python mailing list <https://mail.python.org/pipermail/python-list/2010-October/590762.html>`__,
4444
`IETF mailing list <https://www.ietf.org/mail-archive/web/json/current/msg03739.html>`__ and
45-
`here <https://softwareengineering.stackexchange.com/questions/350623/flat-or-nested-json-for-hierarchal-data>`__.
45+
`in stackexchange <https://softwareengineering.stackexchange.com/questions/350623/flat-or-nested-json-for-hierarchal-data>`__.
4646

4747
****************
4848
Serializing Text
@@ -57,7 +57,7 @@ If the data to be serialized is located in a file and contains flat data, Python
5757
repr
5858
----
5959

60-
The repr method in Python takes a single object parameter and returns a printable representation of the input
60+
The repr method in Python takes a single object parameter and returns a printable representation of the input:
6161

6262
.. code-block:: python
6363
@@ -79,7 +79,7 @@ ast.literal_eval
7979
----------------
8080

8181
The literal_eval method safely parses and evaluates an expression for a Python datatype.
82-
Supported data types are: strings, numbers, tuples, lists, dicts, booleans and None.
82+
Supported data types are: strings, numbers, tuples, lists, dicts, booleans, and None.
8383

8484
.. code-block:: python
8585
@@ -114,8 +114,8 @@ Simple example for writing:
114114
writer.writerows(iterable)
115115
116116
117-
The module's contents, functions and examples can be found
118-
`here <https://docs.python.org/3/library/csv.html>`__.
117+
The module's contents, functions, and examples can be found
118+
`in the Python documentation <https://docs.python.org/3/library/csv.html>`__.
119119

120120
==================
121121
YAML (nested data)
@@ -178,29 +178,29 @@ Example:
178178
root = tree.getroot()
179179
180180
More documentation on using the `xml.dom` and `xml.sax` packages can be found
181-
`here <https://docs.python.org/3/library/xml.html>`__.
181+
`in the Python XML library documentation <https://docs.python.org/3/library/xml.html>`__.
182182

183183

184184
*******
185185
Binary
186186
*******
187187

188188
=======================
189-
Numpy Array (flat data)
189+
NumPy Array (flat data)
190190
=======================
191191

192-
Python's Numpy array can be used to serialize and deserialize data to and from byte representation.
192+
Python's NumPy array can be used to serialize and deserialize data to and from byte representation.
193193

194194
Example:
195195

196196
.. code-block:: python
197197
198-
import numpy as np
198+
import NumPy as np
199199
200-
# Converting Numpy array to byte format
200+
# Converting NumPy array to byte format
201201
byte_output = np.array([ [1, 2, 3], [4, 5, 6], [7, 8, 9] ]).tobytes()
202202
203-
# Converting byte format back to Numpy array
203+
# Converting byte format back to NumPy array
204204
array_format = np.frombuffer(byte_output)
205205
206206

0 commit comments

Comments
 (0)