def get_money_supply():
 rdint = vs.random()
 request = Request((vs.MACRO_URL % (vs.P_TYPE['http'], vs.DOMAINS['sina'], rdint, vs.MACRO_TYPE[2], 1, 600, rdint)))
 text = urlopen(request, timeout=10).read()
 text = text.decode('gbk')
 regSym = re.compile('\\,count:(.*?)\\}')
 datastr = regSym.findall(text)
 datastr = datastr[0]
 datastr = datastr.split('data:')[1]
 js = json.loads(datastr)
 df = pd.DataFrame(js, columns=vs.MONEY_SUPPLY_COLS)
 for i in df.columns:
  df[i] = df[i].apply((lambda x: np.where((x is None), '--', x)))
 return df

def get_money_supply ( ) : rdint = vs . random ( ) request = Request ( ( vs . MACRO_URL % ( vs . P_TYPE [ 'http' ] , vs . DOMAINS [ 'sina' ] , rdint , vs . MACRO_TYPE [ 2 ] , 1 , 600 , rdint ) ) ) text = urlopen ( request , timeout = 10 ) . read ( ) text = text . decode ( 'gbk' ) regSym = re . compile ( '\\,count:(.*?)\\}' ) datastr = regSym . findall ( text ) datastr = datastr [ 0 ] datastr = datastr . split ( 'data:' ) [ 1 ] js = json . loads ( datastr ) df = pd . DataFrame ( js , columns = vs . MONEY_SUPPLY_COLS ) for i in df . columns : df [ i ] = df [ i ] . apply ( ( lambda x : np . where ( ( x is None ) , '--' , x ) ) ) return df
return dataframe month :统计时间 m2 :货币和准货币（广义货币m2） m2_yoy:货币和准货币（广义货币m2）同比增长(%) m1:货币 m1_yoy:货币同比增长(%) m0:流通中现金 m0_yoy:流通中现金同比增长(%) cd:活期存款 cd_yoy:活期存款同比增长(%) qm:准货币 qm_yoy:准货币同比增长(%) ftd:定期存款 ftd_yoy:定期存款同比增长(%) sd:储蓄存款 sd_yoy:储蓄存款同比增长(%) rests:其他存款 rests_yoy:其他存款同比增长(%) .