我有以下代码:
import numpy as np
import pandas as pd
import yfinance as yf
from yahoofinancials import YahooFinancials
yahoo_financials = YahooFinancials('BTC-USD')
data = yahoo_financials.get_historical_price_data("2014-09-17", "2021-11-15", "daily")
btc = pd.DataFrame(data['BTC-USD']['prices'])
btc = btc.drop('date', axis=1).set_index('formatted_date')
但是,运行最后一行代码会给我以下错误:TypeError: int() argument must be a string, a bytes-like object or a number, not '_NoValueType'
. 我知道错误很受欢迎。问题是我尝试的所有解决方案都不起作用。我试图将感兴趣的列转换为,int()
但无法对其进行排序。str()
float()
我究竟做错了什么?
谢谢!