Skip to content

Commit e705ee4

Browse files
immitating interactive mode
For each S3 bucket code block, ideally we show what the output would be, but without making an actual call. Unfortunately, for several of the S3 buckets, there are issues with the code, which we must fix in another commit or PR. For now, the two S3 examples that do work, we edit to make the code block show what the output would have been if it had run successfully. Find details on issues in conversation on PR pandas-dev#56592
1 parent 5ea2948 commit e705ee4

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

doc/source/user_guide/io.rst

+19-9
Original file line numberDiff line numberDiff line change
@@ -1717,11 +1717,18 @@ data by specifying an anonymous connection, such as
17171717

17181718
.. code-block:: python
17191719
1720-
pd.read_csv(
1721-
"s3://ncei-wcsd-archive/data/processed/SH1305/18kHz/SaKe2013"
1722-
"-D20130523-T080854_to_SaKe2013-D20130523-T085643.csv",
1723-
storage_options={"anon": True},
1724-
)
1720+
>>> df = pd.read_csv(
1721+
... "s3://ncei-wcsd-archive/data/processed/SH1305/18kHz/SaKe2013"
1722+
... "-D20130523-T080854_to_SaKe2013-D20130523-T085643.csv",
1723+
... storage_options={"anon": True},
1724+
...)
1725+
>>> df.columns
1726+
Index(['Ping_index', ' Distance_gps', ' Distance_vl', ' Ping_date',
1727+
' Ping_time', ' Ping_milliseconds', ' Latitude', ' Longitude',
1728+
' Depth_start', ' Depth_stop', ' Range_start', ' Range_stop',
1729+
' Sample_count'],
1730+
dtype='object')
1731+
17251732
17261733
``fsspec`` also allows complex URLs, for accessing data in compressed
17271734
archives, local caching of files, and more. To locally cache the above
@@ -3017,10 +3024,13 @@ Biomedical and Life Science Jorurnals:
30173024

30183025
.. code-block:: python
30193026
3020-
pd.read_xml(
3021-
"s3://pmc-oa-opendata/oa_comm/xml/all/PMC1236943.xml",
3022-
xpath=".//journal-meta",
3023-
)
3027+
>>> df = pd.read_xml(
3028+
... "s3://pmc-oa-opendata/oa_comm/xml/all/PMC1236943.xml",
3029+
... xpath=".//journal-meta",
3030+
...)
3031+
>>> df.head(1)
3032+
journal-id journal-title issn publisher
3033+
0 Cardiovasc Ultrasound Cardiovascular Ultrasound 1476-7120 NaN
30243034
30253035
With `lxml`_ as default ``parser``, you access the full-featured XML library
30263036
that extends Python's ElementTree API. One powerful tool is ability to query

doc/source/whatsnew/v2.3.0.rst

-2
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,6 @@ Styler
211211

212212
Other
213213
^^^^^
214-
- Bug when building html documentation from ``doc\source\user_guide\io.rst`` no longer calls S3 bucket URL (:issue:`56592`)
215-
216214
.. ***DO NOT USE THIS SECTION***
217215
218216
-

0 commit comments

Comments
 (0)