parameters: (src_file_name, dest_dir_name)
docstring: 将每个stock的数据拆分成独立的文件
docstring_summary: 将每个stock的数据拆分成独立的文件
docstring_tokens: 将每个stock的数据拆分成独立的文件
function: def fenge2(src_file_name, dest_dir_name):
      """
      将每个stock的数据拆分成独立的文件
      """
      src_hdf5 = tables.openFile(src_file_name, mode='r', filters=tables.Filters(complevel=9,complib='zlib', shuffle=True))
  
      all_table = [x for x in src_hdf5.walkNodes("/")]
      for i in range(1,len(all_table)):
          src_table = all_table[i]
          #print src_table.name
  
          dest_table = dest_hdf5.createTable("/", "data", FiveMinDataRecordH5File, src_table.name)
          dest_row = dest_table.row
           
          pre_date = 0
          for x in src_table:
              if x['datetime'] <= pre_date:
                  print(src_table, pre_date, x['datetime'])
                  continue
  
              try:
                  tmp_date = x['datetime']
                  year = tmp_date / 100000000
                  month  = (tmp_date - year * 100000000) / 1000000
                  day  = (tmp_date - tmp_date / 1000000 * 1000000) / 10000;
                  ttdate = datetime.date(year, month, day)
  
              except ValueError:
                  print(src_table, tmp_date)
  
              else:
  
                  if x['lowPrice'] <= x['openPrice'] <=x['highPrice'] \
                     and x['lowPrice'] <= x['closePrice'] <= x['highPrice']:
                    dest_row['datetime'] = x['datetime']
                    dest_row['openPrice'] = x['openPrice']
                    dest_row['highPrice'] = x['highPrice']
                    dest_row['lowPrice'] = x['lowPrice']
                    dest_row['closePrice'] = x['closePrice']
                    dest_row['transAmount'] = x['transAmount']
                    dest_row['transCount'] = x['transCount']
                    dest_row.append()
                  else:
                    print(src_table, x['datetime'], "warning 2")
          dest_table.flush()
          dest_hdf5.close()
  
      src_hdf5.close()
function_tokens: def fenge2 ( src_file_name , dest_dir_name ) : src_hdf5 = tables . openFile ( src_file_name , mode = 'r' , filters = tables . Filters ( complevel = 9 , complib = 'zlib' , shuffle = True ) ) all_table = [ x for x in src_hdf5 . walkNodes ( "/" ) ] for i in range ( 1 , len ( all_table ) ) : src_table = all_table [ i ] #print src_table.name dest_table = dest_hdf5 . createTable ( "/" , "data" , FiveMinDataRecordH5File , src_table . name ) dest_row = dest_table . row pre_date = 0 for x in src_table : if x [ 'datetime' ] <= pre_date : print ( src_table , pre_date , x [ 'datetime' ] ) continue try : tmp_date = x [ 'datetime' ] year = tmp_date / 100000000 month = ( tmp_date - year * 100000000 ) / 1000000 day = ( tmp_date - tmp_date / 1000000 * 1000000 ) / 10000 ttdate = datetime . date ( year , month , day ) except ValueError : print ( src_table , tmp_date ) else : if x [ 'lowPrice' ] <= x [ 'openPrice' ] <= x [ 'highPrice' ] and x [ 'lowPrice' ] <= x [ 'closePrice' ] <= x [ 'highPrice' ] : dest_row [ 'datetime' ] = x [ 'datetime' ] dest_row [ 'openPrice' ] = x [ 'openPrice' ] dest_row [ 'highPrice' ] = x [ 'highPrice' ] dest_row [ 'lowPrice' ] = x [ 'lowPrice' ] dest_row [ 'closePrice' ] = x [ 'closePrice' ] dest_row [ 'transAmount' ] = x [ 'transAmount' ] dest_row [ 'transCount' ] = x [ 'transCount' ] dest_row . append ( ) else : print ( src_table , x [ 'datetime' ] , "warning 2" ) dest_table . flush ( ) dest_hdf5 . close ( ) src_hdf5 . close ( )