import requests import pandas as pd url = 'https://finance.naver.com/sise/sise_rise.naver?sosok=1' res = pd.read_html(url, encoding='euc-kr') df = res[1].dropna().head() url = 'https://finance.naver.com/sise/sise_rise.naver' res = pd.read_html(url, encoding='euc-kr') df1 = res[1].dropna().head() df = pd.concat([df,df1], axis=0) df = df.sort_values('등락률', ascending=False) df.head() !pip install finance-datareader !pip install mplfinance import FinanceDataReader as fdr import mplfinance as mpf ticker = '058110' df = fdr.DataReader(ticker, '2023-03-09') mpf.plot(df, type='candle', volume=True, style='starsandstripes', savefig=dict(fname=f'{ticker}.jpg')) mpf.plot(df, type='candle', volume=True, style='starsandstripes') url = 'https://launchpad.net/~mario-mariomedina/+archive/ubuntu/talib/+files' ext = '0.4.0-oneiric1_amd64.deb -qO' !wget $url/libta-lib0_$ext libta.deb !wget $url/ta-lib0-dev_$ext ta.deb !dpkg -i libta.deb ta.deb !pip install ta-lib import talib df['RSI'] = talib.RSI(df['Close'], timeperiod=14)