Skip to content

DOC: Fix IPython prompts in io.rst #60704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions doc/source/user_guide/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2340,6 +2340,7 @@ Read a URL with no options:
.. code-block:: ipython

In [320]: url = "https://www.fdic.gov/resources/resolutions/bank-failures/failed-bank-list"

In [321]: pd.read_html(url)
Out[321]:
[ Bank NameBank CityCity StateSt ... Acquiring InstitutionAI Closing DateClosing FundFund
Expand All @@ -2366,6 +2367,7 @@ Read a URL while passing headers alongside the HTTP request:
.. code-block:: ipython

In [322]: url = 'https://www.sump.org/notes/request/' # HTTP request reflector

In [323]: pd.read_html(url)
Out[323]:
[ 0 1
Expand All @@ -2378,14 +2380,16 @@ Read a URL while passing headers alongside the HTTP request:
1 Host: www.sump.org
2 User-Agent: Python-urllib/3.8
3 Connection: close]

In [324]: headers = {
In [325]: 'User-Agent':'Mozilla Firefox v14.0',
In [326]: 'Accept':'application/json',
In [327]: 'Connection':'keep-alive',
In [328]: 'Auth':'Bearer 2*/f3+fe68df*4'
In [329]: }
In [340]: pd.read_html(url, storage_options=headers)
Out[340]:
.....: 'User-Agent':'Mozilla Firefox v14.0',
.....: 'Accept':'application/json',
.....: 'Connection':'keep-alive',
.....: 'Auth':'Bearer 2*/f3+fe68df*4'
.....: }

In [325]: pd.read_html(url, storage_options=headers)
Out[325]:
[ 0 1
0 Remote Socket: 51.15.105.256:51760
1 Protocol Version: HTTP/1.1
Expand Down
Loading