Bring Drag & Drop to Dash with Dashboard Engine. 💫 Learn how at our next webinar!

Help with Pandas pd.read_html


I need some help with Pandas pd.read_html

I have this code that takes the Income Statement table from a specific Company ticker

import pandas as pd
from bs4 import BeautifulSoup
import requests

def getfinancialsdfy(ticker, price, com_name):  

    urlfinancials = ''+ticker+'/financials'

    tables = pd.read_html(urlfinancials)
    tables_a = pd.DataFrame(tables[4])

ejecutar = getfinancialsdfy("AA",22.1, "Alcoa Corp.") 

It’s working fine except that it duplicates the text in the first text column:

Something that is not shown in the original page table:

Anybody knows why and how to solve this issue? :thinking: