Skip to content

DOC:  #54822

Closed
Closed
@idealcrouch

Description

@idealcrouch

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},
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsNeeds TriageIssue that has not been reviewed by a pandas team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions