def get_profit_statement(code):
 if code.isdigit():
  request = Request((ct.SINA_PROFITSTATEMENT_URL % code))
  text = urlopen(request, timeout=10).read()
  text = text.decode('GBK')
  text = text.replace(' DCTB \n', '\r\n')
  text = text.replace(' DCTB ', ',')
  df = pd.read_csv(StringIO(text), dtype={'code': 'object'})
  return df

def get_profit_statement ( code ) : if code . isdigit ( ) : request = Request ( ( ct . SINA_PROFITSTATEMENT_URL % code ) ) text = urlopen ( request , timeout = 10 ) . read ( ) text = text . decode ( 'GBK' ) text = text . replace ( ' DCTB \n' , '\r\n' ) text = text . replace ( ' DCTB ' , ',' ) df = pd . read_csv ( StringIO ( text ) , dtype = { 'code' : 'object' } ) return df
parameters code:str 股票代码 e .