NewGen

[구글 코랩 - 시작] 삼성전자 데이터 수집. 본문

AI & Deep Learning

[구글 코랩 - 시작] 삼성전자 데이터 수집.

Deep Learning 2021. 3. 6. 23:13

딥러닝은 파이썬이 갑인듯..

일단.. 쉬운거 부터 테스트...

1. 일단 삼성전자 데이터 가져오기 부터 시작해보자.

==> yfinance 라이브러리를 이용해서 가져옴.

{'52WeekChange': 0.45309734, 'SandP52WeekChange': 0.39881885, 'address1': '129, Samsung-ro', 'address2': 'Yeongtong-gu', 'algorithm': None, 'annualHoldingsTurnover': None, 'annualReportExpenseRatio': None, 'ask': 82000, 'askSize': 0, 'averageDailyVolume10Day': 28246007, 'averageVolume': 29200361, 'averageVolume10days': 28246007, 'beta': 0.908264, 'beta3Year': None, 'bid': 81900, 'bidSize': 0, 'bookValue': None, 'category': None, 'circulatingSupply': None, 'city': 'Suwon-si', 'companyOfficers': [], 'country': 'South Korea', 'currency': 'KRW', 'dateShortInterest': None, 'dayHigh': 82600, 'dayLow': 81100, 'dividendRate': 7728, 'dividendYield': 0.0938, 'earningsQuarterlyGrowth': 0.233, 'enterpriseToEbitda': 7.107, 'enterpriseToRevenue': 1.949, 'enterpriseValue': 461520374857728, 'exDividendDate': 1609200000, 'exchange': 'KSC', 'exchangeTimezoneName': 'Asia/Seoul', 'exchangeTimezoneShortName': 'KST', 'expireDate': None, 'fiftyDayAverage': 84178.79, 'fiftyTwoWeekHigh': 96800, 'fiftyTwoWeekLow': 42300, 'fiveYearAverageReturn': None, 'fiveYearAvgDividendYield': 2.37, 'floatShares': 5532289471, 'forwardEps': None, 'forwardPE': None, 'fromCurrency': None, 'fundFamily': None, 'fundInceptionDate': None, 'gmtOffSetMilliseconds': '32400000', 'heldPercentInsiders': 0.1942, 'heldPercentInstitutions': 0.43768, 'impliedSharesOutstanding': 6792670208, 'industry': 'Consumer Electronics', 'isEsgPopulated': False, 'lastCapGain': None, 'lastDividendDate': 1545868800, 'lastDividendValue': 354, 'lastFiscalYearEnd': 1609372800, 'lastMarket': None, 'lastSplitDate': 1526428800, 'lastSplitFactor': '50:1', 'legalType': None, 'logo_url': 'https://logo.clearbit.com/samsung.com', 'longBusinessSummary': 'Samsung Electronics Co., Ltd. engages in the consumer electronics, information technology and mobile communications, and device solutions businesses worldwide. It offers mobile phones, tablets, wearables, virtual reality, and audio products; TVs, and home theaters; OLED and LCD panels; laptops, computers, chrome books, HDM, memory and system LSI products, monitors, and printers; and home appliances, such as refrigerators, air conditioners, ovens, air purifiers, cooktops and hoods, microwaves, dishwashers, washers, dryers, vacuum cleaners, and heating products, as well as TV and home theater accessories. It also provides security and monitoring, trackers, Wi-Fi routers, hubs, sensors, outlets, and buttons. In addition, the company is involved in the technology and venture capital investment businesses; manufacture of semiconductor equipment and components; and provision of repair services for electronic devices. Further, it provides medical equipment; software development and supply; toll processing of semiconductors and display panels; connected car systems, general logistics agency, financing, marketing, consulting, AI technology research, and cloud services; enterprise automation solutions and connected services; and digital advertising platforms. Additionally, it offers image sensing devices and mobile payment services; and designs and develops software products. The company serves finance, government, healthcare, education, hospitality, transportation, retail, legal, public safety, and manufacturing industries. Samsung Electronics Co., Ltd. was founded in 1938 and is based in Suwon, South Korea.', 'longName': 'Samsung Electronics Co., Ltd.', 'market': 'kr_market', 'marketCap': 550052737056768, 'maxAge': 1, 'maxSupply': None, 'messageBoardId': 'finmb_91868', 'morningStarOverallRating': None, 'morningStarRiskRating': None, 'mostRecentQuarter': 1609372800, 'navPrice': None, 'netIncomeToCommon': 26090846289920, 'nextFiscalYearEnd': 1672444800, 'open': 81100, 'openInterest': None, 'payoutRatio': 0.77949995, 'pegRatio': None, 'phone': '82 31 200 1114', 'previousClose': 82400, 'priceHint': 2, 'priceToBook': None, 'priceToSalesTrailing12Months': 2.3227894, 'profitMargins': 0.11018, 'quoteType': 'EQUITY', 'regularMarketDayHigh': 82600, 'regularMarketDayLow': 81100, 'regularMarketOpen': 81100, 'regularMarketPreviousClose': 82400, 'regularMarketPrice': 81100, 'regularMarketVolume': 20312925, 'revenueQuarterlyGrowth': None, 'sector': 'Technology', 'sharesOutstanding': 5969780224, 'sharesPercentSharesOut': None, 'sharesShort': None, 'sharesShortPreviousMonthDate': None, 'sharesShortPriorMonth': None, 'shortName': 'SamsungElec', 'shortPercentOfFloat': None, 'shortRatio': None, 'startDate': None, 'strikePrice': None, 'symbol': '005930.KS', 'threeYearAverageReturn': None, 'toCurrency': None, 'totalAssets': None, 'tradeable': False, 'trailingAnnualDividendRate': None, 'trailingAnnualDividendYield': None, 'trailingEps': None, 'twoHundredDayAverage': 69714.19, 'volume': 20312925, 'volume24Hr': None, 'volumeAllCurrencies': None, 'website': 'http://www.samsung.com', 'yield': None, 'ytdReturn': None, 'zip': '443-742'}

 

2. 수집할 수 있는 데이터를 최대 기간으로 설정하여 가져와봄. 아래와 같이 간략하게 수집된 결과를 보여준다.

 

3. 배당정보도 수집해 봄.

4. 대략적인 주가를 시각화 해봄.

 

 

정리.

- 생각보다 간단한 코드로 위의 데이터를 수집하고 시각화 할 수 있슴.

- 복잡한 개발환경을 구축하지 않고, 웹브라우져(구글 크롬 츄챤~~~~!) 만으로 가능했슴.

 

감상.

- 딥러닝 대중화가 이미 시작됫다고 생각함.

Comments