def get_fund_info(code):
 request = (ct.SINA_FUND_INFO_URL % (ct.P_TYPE['http'], ct.DOMAINS['ssf'], code))
 text = urlopen(request, timeout=10).read()
 text = text.decode('gbk')
 org_js = json.loads(text)
 status_code = int(org_js['result']['status']['code'])
 if (status_code != 0):
  status = str(org_js['result']['status']['msg'])
  raise ValueError(status)
 data = org_js['result']['data']
 fund_df = pd.DataFrame(data, columns=ct.FUND_INFO_COLS, index=[0])
 fund_df = fund_df.set_index('symbol')
 return fund_df

def get_fund_info ( code ) : request = ( ct . SINA_FUND_INFO_URL % ( ct . P_TYPE [ 'http' ] , ct . DOMAINS [ 'ssf' ] , code ) ) text = urlopen ( request , timeout = 10 ) . read ( ) text = text . decode ( 'gbk' ) org_js = json . loads ( text ) status_code = int ( org_js [ 'result' ] [ 'status' ] [ 'code' ] ) if ( status_code != 0 ) : status = str ( org_js [ 'result' ] [ 'status' ] [ 'msg' ] ) raise ValueError ( status ) data = org_js [ 'result' ] [ 'data' ] fund_df = pd . DataFrame ( data , columns = ct . FUND_INFO_COLS , index = [ 0 ] ) fund_df = fund_df . set_index ( 'symbol' ) return fund_df
parameters code:string 基金代码 e .