다양한 에러 처리

FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.

  • from
tables = pd.read_html(page.text)
  • to
from io import StringIO

html_buffer = StringIO(page.text)
tables = pd.read_html(html_buffer)

FutureWarning: Series.getitem treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use ser.iloc[pos]

for idx, r in tables[0].iterrows():
  r[0]
  • to
for idx, r in tables[0].iterrows():
  r.iloc[0]

Table of contents 목차

평점을 남겨주세요
평점 : 2.5
총 투표수 : 1