커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
다른 에러가 발생합니다., ModuleNotFoundError: No module named 'FinanceDataReader'
undefined주차
북마크
김*수
댓글
1
추천
0
조회수
5
조회수
5
답변 완료

!pip install FinanceDataReader


import pandas as pd

import FinanceDataReader as fdr



def make_rate(code):

      df = fdr.DataReader(code,'2017')

      original = df[['Close']].iloc[0]

      df = df[['Close']] / original -1

      return df['Close']


def final_rate(code):

      return make_rate(code).iloc[-1]


def final_rate(code):

  try:

    return make_rate(code).iloc[-1]

  except:

    return (-1000)

   

df = fdr.StockListing('SP500')


df = df[['Symbol','Name']].head(100)


df['rate'] = df['Symbol'].apply(final_rate)


cond = df['rate'] > -50

df = df[cond]


df = df.sort_values(by='rate',ascending=False).head(10)


df.set_index('Name',inplace=True)

df.plot(kind='bar')


----------------

ERROR: Could not find a version that satisfies the requirement FinanceDataReader (from versions: none)
ERROR: No matching distribution found for FinanceDataReader
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-4-19dbd03bebf2> in <cell line: 4>()
      2 
      3 import pandas as pd
----> 4 import FinanceDataReader as fdr
      5 
      6 

ModuleNotFoundError: No module named 'FinanceDataReader'
---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.

---------------------------------------------------------------------------

취소
 공유
취소
댓글 0
댓글 알림
나의얼굴