Reputation: 806
I would need to get the tld from this table
tables = pd.read_html("https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains",header=0)
name_country_top_domains=tables[5][['Name[5]']]
country_name=tables[5][['Entity']]
i.e. the table of all countries:
But I get the following error:
KeyError: "None of [Index(['Name[5]'], dtype='object')] are in the [columns]"
Could you please tell me what I am doing wrong?
Upvotes: 0
Views: 143
Reputation: 73
Try using Name[7]
instead of Name[5]
tables = pd.read_html("https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains",header=0)
name_country_top_domains = tables[5][['Name[7]']]
country_name=tables[5][['Entity']]
Upvotes: 2