Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help with python
#5
To much work here is the easy way with the power of Pandas Wink
>>> import pandas as pd

>>> df = pd.read_html('url')[0]
>>> df.rename(columns={'Unnamed: 0': 'Tile'}, inplace=True)
>>> df
Output:
Tile Total Change in last 24 hours 0 Number of confirmed cases in New Zealand 1122 1 1 Number of probable cases 347 -2 2 Number of confirmed and probable cases 1469 -1 3 Number of cases currently in hospital 7 0 4 Number of recovered cases 1180 38 5 Number of deaths (as at 1 pm 27 April) 19 1
Here how it look in a Notebook and it find all tables,so here make a Graph with table 6 and i use Altair.
Reply


Messages In This Thread
help with python - by robin - Apr-26-2020, 08:32 AM
RE: help with python - by Larz60+ - Apr-26-2020, 10:23 AM
RE: help with python - by robin - Apr-26-2020, 10:44 AM
RE: help with python - by Larz60+ - Apr-26-2020, 12:20 PM
RE: help with python - by snippsat - Apr-27-2020, 01:17 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020