+ 3

Python for Finance

Can someone please explain what I am doing wrong? It gives me a KeyError for 'description' on 15.2 in Python for Finance the task is : =================================================================== During this project we will analyze the Bitcoin price, calculate investment values and return rates. The project will have multiple steps, each step requiring the completion of several tasks. At the end of the project we will be able to determine the real price of Bitcoin, and analyze and create charts based on its historic values. Let's get started with the very first task! Task The Bitcoin price can be accessed on Yahoo Finance using the ticker 'BTC-USD'. Import the yfinance package and output the 'description' field of the info object. import yfinance as yf data = yf.Ticker("BTC-USD") Hint: Here is the syntax for accessing the description: data.info['description'] ============================================================= Here is my code : ============================================================= import yfinance as yf data = yf.Ticker("BTC-USD") print(data.info['description']) ======================= Output : ======================= Traceback (most recent call last): File "file0.py", line 4, in <module> print(data.info['description']) KeyError: 'description'

10th Jan 2023, 2:52 PM
Austin Murray
Austin Murray - avatar
6 Réponses
+ 4
Ok so it appears that yFinance had an update on December 20th, 2022. This code works perfect in my PyCharm code editor with the most recent version of yf installed. I need the SoloLearn devs to fix this ASAP so I can continue to progress. Please and Thank You!
10th Jan 2023, 3:17 PM
Austin Murray
Austin Murray - avatar
+ 4
Austin Murray you might need to email them to call their attention to the problem. Send to info@sololearn.com.
10th Jan 2023, 7:46 PM
Brian
Brian - avatar
+ 4
I dont think it has been fixed
17th Feb 2023, 11:46 PM
Austin Murray
Austin Murray - avatar
+ 2
It still has not been fixed.
22nd Feb 2023, 12:52 AM
Taha Günaltay
Taha Günaltay - avatar
+ 2
Same mistake
8th Mar 2023, 6:46 AM
Lê Đình Thắng - FPT University
Lê Đình Thắng - FPT University - avatar
+ 1
Same mistake, can you fixed it?
17th Feb 2023, 11:41 PM
Fede Keller
Fede Keller - avatar