Python學的很淺,有點搞不懂為什么會這樣。
def random_stocks_return(start_date, end_date, n):
ret_list = pd.DataFrame()
for c in random_pick_stocks_code(n):
st = collect_stock_data(c,start_date,end_date)
st_ret = tick2ret(st['close']).to_frame(name = c)
ret_list = pd.concat([ret_list, st_ret], axis = 1 ,join = 'outer', ignore_index = False, sort = False)
ret_list.dropna(axis = 0, how = 'any', inplace = True)
return ret_list
運行時候會出現(xiàn)TypeError: 'NoneType' object is not subscriptable