Quantcast
Channel: I need to show all of columns of dataframe - Stack Overflow
Viewing all articles
Browse latest Browse all 2

I need to show all of columns of dataframe

$
0
0

enter link description here

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 pdurl = "dams.html"table = pd.read_html (url,header=0)[0]tabledams = 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


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>