Classwork 8

Scrapping Web-tables with pd.read_html()

Author

Byeong-Hak Choe

Published

March 10, 2025

Modified

March 11, 2025

Question 1

  • Store the table in the following webpage as a pandasDataFrame:
    • Gasoline Pump Components History
      • Convert the abbreviated month-year string to datetime using pd.to_datetime() with format='%b-%y'.
    • If necessary, use the Series.str.replace() method.
      • For example, Series.str.replace('A', 'B') replaces “A” with “B” in Series.
  • Export the DataFrame as a CSV file.

Answer:



Question 2

Answer:



Discussion

Welcome to our Classwork 8 Discussion Board! 👋

This space is designed for you to engage with your classmates about the material covered in Classwork 8.

Whether you are looking to delve deeper into the content, share insights, or have questions about the content, this is the perfect place for you.

If you have any specific questions for Byeong-Hak (@bcdanl) regarding the Classwork 8 materials or need clarification on any points, don’t hesitate to ask here.

All comments will be stored here.

Let’s collaborate and learn from each other!

Back to top