here is the link of table.
Write Python code that scrapes the first table from the website, converts it into a pandas data frame. As output for Part 1, create a subset named dams containing all the data for the top 3 dams based on their capacity for hydropower generation.
this is my codes.
import pandas as pd
url = "dams.html"
table = pd.read_html (url,header=0)[0]
table
dams = table.groupby('Name').sum()
dams = dams.sort_values('Installed capacity [MW]',ascending = False)[:3]
dams
# I want to show all of columns of original table.
Here are my problem: DataFrame shape mismatch [left]: (3, 4) [right]: (3, 9)
Thank you for your help