강의

멘토링

로드맵

Inflearn Community Q&A

jangtaesan's profile image
jangtaesan

asked

Introduction to Python and Creating Various Automated Applications Using Web Crawling

Using Python Pandas (3) - Daum, Naver Stock Charts

4-7-6 네이버 & 카카오 주식 정보 가져오기

Written on

·

378

0

# [22년 8월 31일 확인]

# https://financedata.github.io/posts/finance-data-reader-users-guide.html
# pip install FinanceDataReader
import FinanceDataReader as fdr

import matplotlib.pyplot as plt

# import pandas_datareader.data as web

import FinanceDataReader as fdr

import datetime

# 조회 시작 및 종료 날짜

start = datetime.datetime(2022,8,16)

end = datetime.datetime(2022,8,31)

# 네이버 주식 정보 조회

df_naver = fdr.DataReader('035420', start, end)

# 카카오 주식 정보 조회

df_kakao = fdr.DataReader('035720', start, end)

# 출력

print(df_naver)

print(df_kakao)

# 윈도우 제목

fig = plt.figure('Chart Test')

# 차트 사이즈 지정

fig.set_size_inches(10, 6, forward=True)

# 차트 설정 1

plt.plot(df_naver.index, df_naver['Close'], 'b', label="Naver")

# 차트 설정 2

plt.plot(df_kakao.index, df_kakao['Close'], 'r', label="Kakao")

# 범례 위치 지정

plt.legend(loc='upper left')

# 차트 제목

plt.title('Naver & Kakao')

# x축 레이블

plt.xlabel('Date')

# y축 레이블

plt.ylabel('Close')

# 차트 실행

plt.show()

python웹-크롤링

Quiz

47% of people got it wrong. Give it a try!

파이썬에서 이진(Binary) 데이터와 텍스트(Text) 데이터의 주요 차이점은 무엇일까요?

텍스트 데이터는 수정할 수 없지만, 이진 데이터는 가능합니다.

이진 데이터는 일반적으로 텍스트 데이터보다 파일 크기가 큽니다.

텍스트 데이터는 사람이 읽고 편집하기 쉽지만, 이진 데이터는 어렵습니다.

이진 데이터는 ASCII 코드로 표현됩니다.

Answer 1

0

niceman님의 프로필 이미지
niceman
Instructor

네 실행한 번 해볼께여~~

감사합니다.

jangtaesan's profile image
jangtaesan

asked

Ask a question