Python學(xué)的很淺,有點(diǎn)搞不懂為什么會(huì)這樣。
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
運(yùn)行時(shí)候會(huì)出現(xiàn)TypeError: 'NoneType' object is not subscriptable