Skip to content

Commit

Permalink
Merge pull request #99 from michaelfm1211/master
Browse files Browse the repository at this point in the history
Change deprecated use of pandas .append() to pd.concat()
  • Loading branch information
atreadw1492 authored Jun 15, 2023
2 parents cecc32e + a411e2b commit e81e5cc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions yahoo_fin/stock_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,15 @@ def get_quote_table(ticker , dict_result = True, headers = {'User-agent': 'Mozil

tables = pd.read_html(requests.get(site, headers=headers).text)

data = tables[0].append(tables[1])
data = pd.concat([tables[0], tables[1]])


data.columns = ["attribute" , "value"]

quote_price = pd.DataFrame(["Quote Price", get_live_price(ticker)]).transpose()
quote_price.columns = data.columns.copy()

data = data.append(quote_price)
data = pd.concat([data, quote_price])

data = data.sort_values("attribute")

Expand Down Expand Up @@ -333,7 +334,7 @@ def get_stats(ticker, headers = {'User-agent': 'Mozilla/5.0'}):

table = tables[0]
for elt in tables[1:]:
table = table.append(elt)
table = pd.concat([table, elt])

table.columns = ["Attribute" , "Value"]

Expand Down

0 comments on commit e81e5cc

Please sign in to comment.