Closed
Description
Pandas version checks
- I have checked that the issue still exists on the latest versions of the docs on
main
here
Location of the documentation
https://pandas.pydata.org/docs/user_guide/io.html#io-read-html
Documentation problem
This script in the documentation returns an error since the source material changed on Wikipedia.
import pandas pd
url_mcc = "https://en.wikipedia.org/wiki/Mobile_country_code"
dfs = pd.read_html(
url_mcc,
match="Telekom Albania",
header=0,
converters={"MNC": str},
)
returns the error
ValueError: No tables found matching pattern 'Telekom Albania'
Suggested fix for documentation
I believe the fix is to simply match on a different table name (not Telekom Albania). Even using "Albania" works for me.
import pandas as pd
url_mcc = "https://en.wikipedia.org/wiki/Mobile_country_code"
dfs = pd.read_html(
url_mcc,
match="Albania",
header=0,
converters={"MNC": str},
)