Get HTML table into pandas Dataframe, not list of dataframe objects

前端 未结 2 516
别跟我提以往
别跟我提以往 2020-12-31 09:15

I apologize if this question has been answered elsewhere but I have been unsuccessful in finding a satisfactory answer here or elsewhere.

I am somewhat new to python

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-31 09:42

    pd.read_html returns you a list with one element and that element is the pandas dataframe, i.e.

    df = pd.read_html(url) ###<-- List
    
    df[0] ###<-- Pandas DataFrame
    

提交回复
热议问题