AlenkaF commented on a change in pull request #12543:
URL: https://github.com/apache/arrow/pull/12543#discussion_r831889465
##########
File path: python/pyarrow/_csv.pyx
##########
@@ -121,6 +121,59 @@ cdef class ReadOptions(_Weakrefable):
encoding : str, optional (default 'utf8')
The character encoding of the CSV data. Columns that cannot
decode using this encoding can still be read as Binary.
+
+ Example
+ -------
+
+ Defining an example file from bytes object:
+
+ >>> import io
+ >>> s = b'''1,2,3
+ ... Flamingo,2,2022-03-01
+ ... Horse,4,2022-03-02
+ ... Brittle stars,5,2022-03-03
+ ... Centipede,100,2022-03-04'''
Review comment:
Yes, I used `\n` in the example above and the docstrings got printed
multi-lined in interactive session.
Corrected docstrings for `csv.read_csv()`:
```
Examples
--------
Defining an example file from bytes object:
>>> import io
>>> s =
b'animals,n_legs,entry\nFlamingo,2,2022-03-01\nHorse,4,2022-03-02\nBrittle
stars,5,2022-03-03\nCentipede,100,2022-03-04
>>> print(s.decode())
Reading from the file
...
```
and docstring print for `csv.read_csv?`:
```
Examples
--------
Defining an example file from bytes object:
>>> import io
>>> s = b'animals,n_legs,entry
Flamingo,2,2022-03-01
Horse,4,2022-03-02
Brittle stars,5,2022-03-03
Centipede,100,2022-03-04
>>> print(s.decode())
Reading from the file
...
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]