TypeError : 'Int64Index'개체를 호출 할 수 없습니다.

ComputerBoi

이 오류가 발생하는 이유는 무엇입니까?

ticker = 'NFLX'
price = get_data(ticker, start_date='2020-01-01', end_date=None, index_as_date=bool, interval ='1d')
price.to_csv(r'D:\Python Stuff\pythonProject\NFLX.csv')
df = pd.read_csv('NFLX.csv')
price_list = df['adjclose']
change = price_list.diff(1)


def RSI():
    change.dropna(inplace=True)
    positive = change.copy()
    negative = change.copy()
    positive[positive < 0] = 0
    negative[negative > 0] = 0

    RSI_days = 5

    average_gain = positive.rolling(window=RSI_days).mean()
    average_loss = abs(negative.rolling(window=RSI_days).mean())
    relative_strength = average_gain/average_loss
    rsi = 100.0-(100.0/(1.0+relative_strength))
    return rsi

relative_strength_index = RSI()

print(relative_strength_index[-6:])

lowest_rsi = min(relative_strength_index[-6:])
print(lowest_rsi)

index_number = relative_strength_index[-6:].index(lowest_rsi)
print('index of lowest rsi = ' + index_number)

코드를 실행할 때 내 오류는 "TypeError : 'Int64Index'object is not callable"입니다. 이 오류를 해결하기 위해이 코드를 어떻게 개선 할 수 있습니까?

사이먼 산체스

괄호에 교체 index(lowest_rsi)괄호

index_number = relative_strength_index[-6:].index[lowest_rsi.astype(int)]
print('index of lowest rsi = ' + index_number)

편집 : 코드는 다음과 같이 보일 것입니다.

relative_strength_index = RSI()

print(relative_strength_index[-6:])

index_number = relative_strength_index[-6:].idxmin()
print('index of lowest rsi =', index_number)

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Python Script TypeError : 'int'개체를 호출 할 수 없습니다.

분류에서Dev

Python setter TypeError : 'int'개체를 호출 할 수 없습니다.

분류에서Dev

TypeError : 'numpy.float64'개체를 호출 할 수 없습니까?

분류에서Dev

TypeError : '_IncompatibleKeys'개체를 호출 할 수 없습니다.

분류에서Dev

TypeError : 'NoneType'개체는 CircleCI를 호출 할 수 없습니다.

분류에서Dev

TypeError : 'CurrencyConverter'개체를 호출 할 수 없습니다.

분류에서Dev

firebase = firebase (config) TypeError : 'module'개체를 호출 할 수 없습니다.

분류에서Dev

TypeError : '목록'개체를 호출 할 수 없습니다-assertWarns ()

분류에서Dev

TypeError : '목록'개체를 호출 할 수 없습니다-assertWarns ()

분류에서Dev

Q : TypeError : '_csv.reader'개체를 호출 할 수 없습니다.

분류에서Dev

TypeError : 'Player'개체는 Django를 호출 할 수 없습니다.

분류에서Dev

TypeError : 'Post'개체를 호출 할 수 없습니다.

분류에서Dev

groupby-TypeError 'DataFrame'개체를 호출 할 수 없습니다.

분류에서Dev

Python 오류 : TypeError : 'list'개체를 호출 할 수 없습니다.

분류에서Dev

TypeError : '게임'개체를 호출 할 수 없습니다.

분류에서Dev

Python / Pygame : TypeError : '모듈'개체를 호출 할 수 없습니다.

분류에서Dev

Python-TypeError : 'list'개체를 호출 할 수 없습니다.

분류에서Dev

TypeError : 'Weather'개체를 호출 할 수 없습니다.

분류에서Dev

TypeError : 'Aircraft'개체를 호출 할 수 없습니다.

분류에서Dev

Python TypeError : '모듈'개체를 호출 할 수 없습니다.

분류에서Dev

TypeError '모듈'개체를 호출 할 수 없습니다.

분류에서Dev

django-selenium TypeError : 'str'개체를 호출 할 수 없습니다.

분류에서Dev

TypeError : print를 호출 할 때 'str'개체를 호출 할 수 없습니다.

분류에서Dev

TypeError : 'int'객체는 호출 할 수 없습니다 .``, len ()

분류에서Dev

TypeError : 'int'객체는 Python 3을 호출 할 수 없습니다.

분류에서Dev

TypeError : 'int'객체는 Python으로 호출 할 수 없습니다.

분류에서Dev

Python Tkinter TypeError : 'int'객체는 호출 할 수 없습니다.

분류에서Dev

TypeError : 'numpy.float64'개체를 호출 할 수 없습니다-F1 점수를 인쇄하는 동안

분류에서Dev

Python TypeError : 'int'개체는 OOP에서 호출 할 수 없습니다.

Related 관련 기사

  1. 1

    Python Script TypeError : 'int'개체를 호출 할 수 없습니다.

  2. 2

    Python setter TypeError : 'int'개체를 호출 할 수 없습니다.

  3. 3

    TypeError : 'numpy.float64'개체를 호출 할 수 없습니까?

  4. 4

    TypeError : '_IncompatibleKeys'개체를 호출 할 수 없습니다.

  5. 5

    TypeError : 'NoneType'개체는 CircleCI를 호출 할 수 없습니다.

  6. 6

    TypeError : 'CurrencyConverter'개체를 호출 할 수 없습니다.

  7. 7

    firebase = firebase (config) TypeError : 'module'개체를 호출 할 수 없습니다.

  8. 8

    TypeError : '목록'개체를 호출 할 수 없습니다-assertWarns ()

  9. 9

    TypeError : '목록'개체를 호출 할 수 없습니다-assertWarns ()

  10. 10

    Q : TypeError : '_csv.reader'개체를 호출 할 수 없습니다.

  11. 11

    TypeError : 'Player'개체는 Django를 호출 할 수 없습니다.

  12. 12

    TypeError : 'Post'개체를 호출 할 수 없습니다.

  13. 13

    groupby-TypeError 'DataFrame'개체를 호출 할 수 없습니다.

  14. 14

    Python 오류 : TypeError : 'list'개체를 호출 할 수 없습니다.

  15. 15

    TypeError : '게임'개체를 호출 할 수 없습니다.

  16. 16

    Python / Pygame : TypeError : '모듈'개체를 호출 할 수 없습니다.

  17. 17

    Python-TypeError : 'list'개체를 호출 할 수 없습니다.

  18. 18

    TypeError : 'Weather'개체를 호출 할 수 없습니다.

  19. 19

    TypeError : 'Aircraft'개체를 호출 할 수 없습니다.

  20. 20

    Python TypeError : '모듈'개체를 호출 할 수 없습니다.

  21. 21

    TypeError '모듈'개체를 호출 할 수 없습니다.

  22. 22

    django-selenium TypeError : 'str'개체를 호출 할 수 없습니다.

  23. 23

    TypeError : print를 호출 할 때 'str'개체를 호출 할 수 없습니다.

  24. 24

    TypeError : 'int'객체는 호출 할 수 없습니다 .``, len ()

  25. 25

    TypeError : 'int'객체는 Python 3을 호출 할 수 없습니다.

  26. 26

    TypeError : 'int'객체는 Python으로 호출 할 수 없습니다.

  27. 27

    Python Tkinter TypeError : 'int'객체는 호출 할 수 없습니다.

  28. 28

    TypeError : 'numpy.float64'개체를 호출 할 수 없습니다-F1 점수를 인쇄하는 동안

  29. 29

    Python TypeError : 'int'개체는 OOP에서 호출 할 수 없습니다.

뜨겁다태그

보관