---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
<ipython-input-252-2d1cbd66b3d0> in <module>()
----> 1 codes['code'].map(check)
/home/work/anaconda/lib/python2.7/site-packages/pandas/core/series.pyc in map(self, arg, na_action)
2014 index=self.index).__finalize__(self)
2015 else:
-> 2016 mapped = map_f(values, arg)
2017 return self._constructor(mapped,
2018 index=self.index).__finalize__(self)
pandas/src/inference.pyx in pandas.lib.map_infer (pandas/lib.c:58435)()
<ipython-input-245-f47b60fe913b> in check(code, start)
1 def check(code, start='2015-01-01'):
2 hfq_df_my = pd.read_sql('select * from t_daily_qfq_stock where code="%s" and date>="%s"'%(code,start), con=utils.getEngine())
----> 3 hfq_df_ts = ts.get_h_data(code,start=start,autype='qfq')
4 return any(hfq_df_my['close'].sort_index(ascending=False) == hfq_df_ts)
/home/work/anaconda/lib/python2.7/site-packages/tushare/stock/trading.pyc in get_h_data(code, start, end, autype, index, retry_count, pause)
385 if autype == 'qfq':
386 data = data.drop('factor', axis=1)
--> 387 df = _parase_fq_factor(code, start, end)
388 df = df.drop_duplicates('date')
389 df = df.sort('date', ascending=False)
/home/work/anaconda/lib/python2.7/site-packages/tushare/stock/trading.pyc in _parase_fq_factor(code, start, end)
429 request = Request(ct.HIST_FQ_FACTOR_URL%(ct.P_TYPE['http'],
430 ct.DOMAINS['vsf'], symbol))
--> 431 text = urlopen(request, timeout=10).read()
432 text = text[1:len(text)-1]
433 text = text.decode('utf-8') if ct.PY3 else text
/home/work/anaconda/lib/python2.7/urllib2.pyc in urlopen(url, data, timeout, cafile, capath, cadefault, context)
152 else:
153 opener = _opener
--> 154 return opener.open(url, data, timeout)
155
156 def install_opener(opener):
/home/work/anaconda/lib/python2.7/urllib2.pyc in open(self, fullurl, data, timeout)
429 req = meth(req)
430
--> 431 response = self._open(req, data)
432
433 # post-process response
/home/work/anaconda/lib/python2.7/urllib2.pyc in _open(self, req, data)
447 protocol = req.get_type()
448 result = self._call_chain(self.handle_open, protocol, protocol +
--> 449 '_open', req)
450 if result:
451 return result
/home/work/anaconda/lib/python2.7/urllib2.pyc in _call_chain(self, chain, kind, meth_name, *args)
407 func = getattr(handler, meth_name)
408
--> 409 result = func(*args)
410 if result is not None:
411 return result
/home/work/anaconda/lib/python2.7/urllib2.pyc in http_open(self, req)
1225
1226 def http_open(self, req):
-> 1227 return self.do_open(httplib.HTTPConnection, req)
1228
1229 http_request = AbstractHTTPHandler.do_request_
/home/work/anaconda/lib/python2.7/urllib2.pyc in do_open(self, http_class, req, **http_conn_args)
1198 else:
1199 try:
-> 1200 r = h.getresponse(buffering=True)
1201 except TypeError: # buffering kw not supported
1202 r = h.getresponse()
/home/work/anaconda/lib/python2.7/httplib.pyc in getresponse(self, buffering)
1130
1131 try:
-> 1132 response.begin()
1133 assert response.will_close != _UNKNOWN
1134 self.__state = _CS_IDLE
/home/work/anaconda/lib/python2.7/httplib.pyc in begin(self)
451 # read until we get a non-100 response
452 while True:
--> 453 version, status, reason = self._read_status()
454 if status != CONTINUE:
455 break
/home/work/anaconda/lib/python2.7/httplib.pyc in _read_status(self)
407 def _read_status(self):
408 # Initialize with Simple-Response defaults
--> 409 line = self.fp.readline(_MAXLINE + 1)
410 if len(line) > _MAXLINE:
411 raise LineTooLong("header line")
/home/work/anaconda/lib/python2.7/socket.pyc in readline(self, size)
478 while True:
479 try:
--> 480 data = self._sock.recv(self._rbufsize)
481 except error, e:
482 if e.args[0] == EINTR:
KeyboardInterrupt: